loopbackio / loopbackio/loopback-next
Docs: How to receive context in controller
オープン
まだ誰も着手していません。
developer-experience
Docs
good first issue
help wanted
- 主要言語
- TypeScript
- スター
- 5.1k
- フォーク
- 1.1k
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 27
説明
Is there any way to receive the context inside a controller?
Goal is to access request data (headers, ip, etc.)
Thanks
Acceptance criteria
- a section in Controllers.html explaining how to access request and response headers or body by using decorators like
@inject(RestBindings.Http.REQUEST) public request: Requestfor different cases:- A request header shared by most (or all) endpoints and processed by an express middleware/LB4 sequence action. Example: Authorization or X-API-Key.
- A request header shared by many endpoints but used internally in the endpoint implementation (an express route handler/LB4 controller method). Maybe come up with a somewhat realistic example of such header.
- A response header set by an express middleware/LB4 sequence action. For example X-Rate-Limit information provided by a rate-limiting extension in all responses.
- A response header set by the endpoint (an express route handler/LB4 controller method). An example: Location header included ind 201 Created responses.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Controllers.html と、文書化されている @inject(RestBindings.Http.REQUEST) パターンから始めます。middleware または sequence actions、ならびに controller methods におけるリクエストとレスポンスのヘッダーまたはボディを扱う例を追加します。Authorization または X-API-Key、rate-limit、Location のケースを含め、その後、すべての受け入れ基準が満たされていることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- express, typescript
- 領域
- api, documentation
- issue の種類
- ドキュメント
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100