0
0

More than 1 year has passed since last update.

AWS Lambdaで、パスパラメータから値を取得する

Posted at

パスパラメータから値を取得する

Lambda関数に、以下のコードを追加します。

let name = event.pathParameters.name;
console.info(`name: ${name}`);

WebStormを使って、ローカル環境で実行する

「Edit Configurations...」をクリックします。
スクリーンショット 2021-12-30 7.25.33.png

「API Gateway AWS Proxy」をクリックします。
スクリーンショット 2021-12-30 7.26.41.png

「pathParamters」に、nameを追加します。
スクリーンショット 2021-12-30 7.22.58.png

Lambda関数を実行します。
パスパラメーターから取得した値が出力されました。
スクリーンショット 2021-12-30 7.29.11.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0