CodeGenieApp / CodeGenieApp/serverless-express

Correct way to "do nothing"

Aperta
#434 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
5.3k
Fork
676
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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)?

```javascript
// ... (passport / express setup)

app.get('*', (req, res) => {
if (req.isAuthenticated()) {
return; // What should come here?
} else {
res.redirect('/login');
}
})
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start at the app.get('*') callback and review the repository's Express and Lambda@Edge integration guidance. Determine how an authenticated ViewerRequest should continue without a redirect, then document the supported behavior and a clear completion example.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, express, javascript
Ambito
backend, cloud
Tipo di issue
Documentazione
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.