0
1

More than 3 years have passed since last update.

lamda, api gateway使って、クライアントに値を返すなど

Last updated at Posted at 2020-03-15

主に自分用メモ。

client->api gateway->youtube apiとかやりたい。

参考: Amazon API Gateway とは?

まずlamda, api gaytewayを触ってみる

下記を見ればだいたいわかる。
ゼロから作りながら覚えるAPI Gateway環境構築

lamdaでのコードをローカルで作る際にはこちらを参考にした。
https://qiita.com/toshihirock/items/d28505442526e0ae7793

次にapi gateway->youtube apiをやってみる

ココやる上で、手元ではうまくresponse返ってきてるが、lamdaのところではresponseがnullになってて、なんでだろうとしていた。
結論は、event handlerが非同期的に処理される?ので、promiseとかでちゃんと作って値を返さないとだめだった。

youtube用には下記のnpmを利用した。
https://github.com/nodenica/youtube-node

外から叩いてみて、値が返ってたらOK!

0
1
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
1