serverless-express
serverless-express copied to clipboard
Correct way to "do nothing"
Hello, and first of all thanks for the very nice library :).
I have a simple use case, I want to authenticate using passport and if the user is authenticated, the function should do nothing. It will run as lambda@edge at ViewerRequest
for cloudfront.
What is the correct way to do nothing, return or call one of the response methods (to set 200
, something like that)?
// ... (passport / express setup)
app.get('*', (req, res) => {
if (req.isAuthenticated()) {
return; // What should come here?
} else {
res.redirect('/login');
}
})