Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AWS Serverless Express 入門
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Nokogiri
August 03, 2018
Technology
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AWS Serverless Express 入門
AWS Lambda を使って Express を 一瞬で公開する方法
Nokogiri
August 03, 2018
More Decks by Nokogiri
See All by Nokogiri
Zustandを用いた実践的状態管理
undefined_name
3
940
React Testing Libraryでの WAI-ARIAロールの活用事例
undefined_name
1
220
自動テストは何の役に立つのか そして役に立たないのか
undefined_name
5
1.9k
Pipe Operator (|>) の紹介
undefined_name
2
420
FizzBuzzで学ぶOCP
undefined_name
0
180
エンジニアとQAでコラボするフロントエンドリアーキテクチャ開発の事例
undefined_name
4
3.3k
オブジェクト指向のプラクティスをフロントエンドで活用する
undefined_name
7
1.8k
モププロ@kintone開発チーム
undefined_name
1
680
勉強会で登壇者に 質問しづらい課題を解決する サービスをリリースしました🎉
undefined_name
2
1.4k
Other Decks in Technology
See All in Technology
Running Kotlin + Quarkus with Lambda
nealle
1
3.7k
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
190
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
250
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
7
6k
AI コーディングと人間の認知スループット / CTO Night & Day 2026 Morning Session / AI Coding and Human Cognitive Throughput
prog893
4
1k
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
470
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
300
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
440
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
860
Metadata - Section 1: HTML Basics
mohab1
0
120
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.8k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
600
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
New Earth Scene 8
popppiees
4
2.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Typedesign – Prime Four
hannesfritz
42
3.2k
The browser strikes back
jonoalderson
0
1.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Utilizing Notion as your number one productivity tool
mfonobong
4
620
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
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!