Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serverless Frameworkで フロント主導なAPI開発

Serverless Frameworkで フロント主導なAPI開発

Serverless 勉強会@京都 vol.1

Hidetaka Okamoto

December 31, 2017
Tweet

More Decks by Hidetaka Okamoto

Other Decks in Technology

Transcript

  1. w 8 P S E # F O D I

    ژ ౎ Ϟ σ Ϩ ʔ λ  w 8 P S E 1 S F T T ೔ ຊ ޠ ϑ Υ ʔ ϥϜ ੈ ࿩ ໾  w 8 P S E $ B N Q  ,Z P U P      ࣮ ߦ ҕ һ ௕  )JEFUBLB0LBNPUP %JHJUBMDVCF%FWFMPQFS
  2. ίϚϯυ̏ͭͰΠϯετʔϧ͔ΒσϓϩΠ·Ͱ IUUQTTFSWFSMFTTDPN #Install serverless globally $ npm install serverless -g

    # Create a serverless function $ serverless create --template hello-world # Deploy to cloud provider $ serverless deploy # Function deployed! Trigger with live url $ curl http://xyz.amazonaws.com/hello-world
  3. /PEFKT΍1ZUIPOͰϨεϙϯε͚ͩ࡞Δ DBMMCBDL ʹ+40/Λ٧ΊࠐΉ͚ͩ 'use strict'; module.exports.hello = (event, context, callback)

    => { const response = { statusCode: 200, body: JSON.stringify({ message: 'Hello World', }), }; callback(null, response); };