CodeGenieApp / CodeGenieApp/serverless-express

RIE instructions missing

オープン
#659 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
5.3k
フォーク
674
PR マージ指標
30日以内にマージされた PR はありません

説明

can you please add somewhere that the command to test must include (unlike "normal" lambda runtimes?) a body [like so][ref]:

```json5
{
"resource": "/",
"path": "/",
"httpMethod": "GET",
"requestContext": {
"resourcePath": "/",
"httpMethod": "GET",
"path": "/Prod/",
// ...
},
// ....
}
```

e.g.:

```
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"requestContext": {}, "path": "/", "httpMethod": "GET"}'
```

[ref]: https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html

rest of post

amazon claims that testing with the Runtime-Interface-Emulator (aka `rie`) should be possible by performing these steps:

https://github.com/aws/aws-lambda-nodejs-runtime-interface-client#local-testing

1. install rie:

```
mkdir -p ~/.aws-lambda-rie && \
curl -Lo ~/.aws-lambda-rie/aws-lambda-rie https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie && \
chmod +x ~/.aws-lambda-rie/aws-lambda-rie
```

2. run app:
```
docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \
--entrypoint /aws-lambda/aws-lambda-rie \
myfunction:latest \
/usr/local/bin/npx aws-lambda-ric app.handler
```

3. post an event:
```
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
```

this does not work with this package, because some additional fields must be present.

other commands i tried:

```
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"requestContext": {}, "path": "/"}'
```

and then finally after looking here https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html:

```
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"requestContext": {}, "path": "/", "httpMethod": "GET"}'
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

既存のRIEまたはローカルテストのドキュメントを見つけ、そのcurlの例をAWS API Gatewayイベントの要件およびリンクされているRIEのガイダンスと比較します。必要なリクエストボディの例をドキュメントに追加し、ドキュメントに記載されたDocker/RIEの呼び出しとcurlコマンドの整合性を確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, docker, javascript, node.js
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。