Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AWS Serverless Express 入門
Search
Nokogiri
August 03, 2018
Technology
0
1.2k
AWS Serverless Express 入門
AWS Lambda を使って Express を 一瞬で公開する方法
Nokogiri
August 03, 2018
Tweet
Share
More Decks by Nokogiri
See All by Nokogiri
React Testing Libraryでの WAI-ARIAロールの活用事例
undefined_name
1
160
自動テストは何の役に立つのか そして役に立たないのか
undefined_name
4
1.7k
Pipe Operator (|>) の紹介
undefined_name
2
330
FizzBuzzで学ぶOCP
undefined_name
0
110
エンジニアとQAでコラボするフロントエンドリアーキテクチャ開発の事例
undefined_name
4
2.8k
オブジェクト指向のプラクティスをフロントエンドで活用する
undefined_name
7
1.6k
モププロ@kintone開発チーム
undefined_name
1
590
勉強会で登壇者に 質問しづらい課題を解決する サービスをリリースしました🎉
undefined_name
2
1.2k
Usefull GitLens
undefined_name
3
810
Other Decks in Technology
See All in Technology
AIのAIによるAIのための出力評価と改善
chocoyama
2
540
変化する開発、進化する体系時代に適応するソフトウェアエンジニアの知識と考え方(JaSST'25 Kansai)
mizunori
1
200
生成AIで小説を書くためにプロンプトの制約や原則について学ぶ / prompt-engineering-for-ai-fiction
nwiizo
3
740
製造業からパッケージ製品まで、あらゆる領域をカバー!生成AIを利用したテストシナリオ生成 / 20250627 Suguru Ishii
shift_evolve
PRO
1
120
MySQL5.6から8.4へ 戦いの記録
kyoshidaxx
1
170
AIエージェント最前線! Amazon Bedrock、Amazon Q、そしてMCPを使いこなそう
minorun365
PRO
13
4.8k
[TechNight #90-1] 本当に使える?ZDMの新機能を実践検証してみた
oracle4engineer
PRO
3
160
PHPでWebブラウザのレンダリングエンジンを実装する
dip_tech
PRO
0
200
LinkX_GitHubを基点にした_AI時代のプロジェクトマネジメント.pdf
iotcomjpadmin
0
170
AWS CDK 実践的アプローチ N選 / aws-cdk-practical-approaches
gotok365
6
680
20250623 Findy Lunch LT Brown
3150
0
840
Uniadex__公開版_20250617-AIxIoTビジネス共創ラボ_ツナガルチカラ_.pdf
iotcomjpadmin
0
160
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.9k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
For a Future-Friendly Web
brad_frost
179
9.8k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
670
Automating Front-end Workflow
addyosmani
1370
200k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
The Cost Of JavaScript in 2023
addyosmani
51
8.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Transcript
2018/08/03 ؔNodeֶԂ 3࣌ݶ AWS Serverless Eλpress ೖ AWS Lambda Λͬͯ
Express Λ ҰॠͰެ։͢Δํ๏
AWS Serverless Express ͬͯ·͔͢ʁ
JavaScript / Java / React / AWS / Vim ͡Ί·ͯ͠!
Taiki Nishi @nkgrnkgr Nokogiri Blog nkgrnkgr.github.io WebΞϓϦέʔγϣϯΤϯδχΞ ๏ਓ͚άϧʔϓΣΞαʔϏεͷ։ൃ HN: Nokogiri(nkgrnkgr) Ұࣇͷʢࠓ݄ೋࣇͷʹͳΓ·͢ ʣ Speaker Deck
Expressͬͨ͜ͱ͋Γ·͔͢ʁ
AWS Lambdaͬͨ͜ͱ͋Γ·͔͢ʁ
ExpressΛ͍ͬͯΔਓ͕ AWS LambdaΛͬͯ ͤʹͳΕΔͰ͢ ☺
What is Serverless ? ͦͦServerlessͱʁ 1
αʔόʔϨείϯϐϡʔςΟϯάͱɺΫϥυϓϩό Πμʔ͕ΞϓϦέʔγϣϯʹඞཁͳϚγϯϦιʔεͷׂ ΓͯΛಈతʹཧ͠ɺࣄલʹߪೖ͞Εͨ͜ͱʹجͮ͘ ٻͰͳ͘ɺ֤ΞϓϦέʔγϣϯཁٻΛຬͨͨ͢Ίʹ ༻͞ΕΔݸʑͷϦιʔεྔʹج͍ͮͨٻΛߦ͏Α͏ ͳΫϥυίϯϐϡʔςΟϯάϞσϧɻ “ Wikipedia ΑΓ
CLOUD FUNCTIONS AWS Lambda Azure functions ओͳ Serverless Platform
CLOUD FUNCTIONS AWS Lambda Azure functions ओͳ Serverless Platform Today’s
Topic
AWS Lambda ͷಛ ։ൃऀ͕࣮ߦڥͷαʔόʔΛ४උͤͣίʔυΛσϓϩΠ͢Δ͚ͩ HTTP ϦΫΤετͳͲ༷ʑͳΠϕϯτΛτϦΨʔʹؔΛ࣮ߦ͢Δ Φʔτεέʔϧ ॳճىಈʹ͕͔͔࣌ؒΔ σϓϩΠͰ͖ΔϑΝΠϧαΠζ͕ 50MB
·Ͱ 1ϦΫΤετ͋ͨΓͷ࠷େ࣮ߦ͕࣌ؒ 300ඵ ͍Ͳ͜ΖΛબͿ͕ͱʹ͔͍҆͘ 1ϲ݄ 100M ϦΫΤετ·Ͱແྉ Ҏ߱ 100M ϦΫΤετຖʹ 0.2 US$
What is AWS Serverless Express ? AWS Serverless Express ͱʁ
2
AWS Serverless Express AWS LambdaͱAPI Gatewayͷ্ʹɺExpress༻ͯ͠αʔόʔϨε ΞϓϦέʔγϣϯͱREST APIΛ࣮ߦ͢ΔAWSެࣜϥΠϒϥϦ ExpressͷMiddleware ʹՃ͢Δ͚ͩͰ
LambdaͰ࣮ߦՄೳʹͳΔ https://github.com/awslabs/aws-serverless-express
How to use 3
Express ʹ aws-serverless-express ΛΠϯετʔϧ STEP1 STEP2 STEP3 STEP4 ❯ npm
install aws-serverless-express +
[email protected]
updated 1 package and audited 198 packages in 2.889s found 2 low severity vulnerabilities run `npm audit fix` to fix them, or `npm audit` for details
const awsServerlessExpress = require('aws-serverless-express'); const app = require('./app'); const server
= awsServerlessExpress.createServer(app); exports.handler = (event, context) => awsServerlessExpress.proxy(server, event, context); Lambda ͔Βݺͼग़͞ΕΔ handler Λ࡞ STEP1 STEP2 STEP3 STEP4 index.js
ࠓ Express ͷ middleware ʹ ͜ͷϥΠϒϥϦΛՃ STEP1 STEP2 STEP3 STEP4
const serverlessExpress = require('aws-serverless-express/middleware'); var app = express(); app.use(serverlessExpress.eventContext()); app.js
ࠓ Express ͷ middleware ʹ ͜ͷϥΠϒϥϦΛՃ STEP1 STEP2 STEP3 STEP4
const serverlessExpress = require('aws-serverless-express/middleware'); var app = express(); app.use(serverlessExpress.eventContext()); app.js ΞϓϦέʔγϣϯͱͯ͠Δ͜ͱҎ্ͰऴΘΓ
Lambda ͷσϓϩΠ Serverless Flamework Λར༻ STEP1 STEP2 STEP3 STEP4 $
npm install serverless -g +
[email protected]
updated 3 packages in 11.062s https://serverless.com/framework/
σϓϩΠ༻ʹ ઃఆϑΝΠϧΛ࡞ STEP1 STEP2 STEP3 STEP4 service: serverless-express-example provider: name:
aws runtime: nodejs8.10 stage: dev region: ap-northeast-1 functions: app: handler: index.handler events: - http: ANY / - http: 'ANY {proxy+}' serverless.yml
❯ sls deploy Serverless: Packaging service... Serverless: Excluding development dependencies...
Serverless: Uploading CloudFormation file to S3... Serverless: Uploading artifacts... Serverless: Uploading service .zip file to S3 (2.16 MB)... Serverless: Validating template... Serverless: Updating Stack... Serverless: Checking Stack update progress... .............. Serverless: Stack update finished... Service Information service: serverless-express-example stage: dev region: ap-northeast-1 stack: serverless-express-example-dev api keys: None endpoints: ANY - https://u8klxp40gc.execute-api.ap-northeast-1.amazonaws.com/dev ANY - https://u8klxp40gc.execute-api.ap-northeast-1.amazonaws.com/dev/{proxy+} functions: app: serverless-express-example-dev-app APIGawayͷEndPointsͷ࡞͔ΒίʔυͷσϓϩΠ·Ͱશ෦ͬͯ͘ΕΔ STEP1 STEP2 STEP3 STEP4
URLʹΞΫηεͨ͠Βެ։͞Εͯ·͢ STEP1 STEP2 STEP3 STEP4
ϥΠϒίʔσΟϯά %
Thanks!