CodeGenieApp / CodeGenieApp/serverless-express
Correct way to "do nothing"
- 主要言語
- JavaScript
- スター
- 5.3k
- フォーク
- 674
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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');
}
})
```
コントリビューションガイド
調査の方向性
app.get('*') のコールバックから始め、リポジトリの Express および Lambda@Edge の統合ガイダンスを確認します。認証済みの ViewerRequest がリダイレクトなしでどのように処理を継続すべきかを判断し、サポートされている動作と明確な完了例をドキュメント化します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- aws, express, javascript
- 領域
- backend, cloud
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100