Amplify山あり_谷あり奮闘記.pdf

 Amplify山あり_谷あり奮闘記.pdf

F68a145ec870bf173a932bc409b20fab?s=128

j-yamamoto

July 31, 2020
Tweet

Transcript

  1. "NQMJGZ ࢁ͋Γɺ୩͋Γฃಆه φΠϧגࣜձࣾ ࢁຊ४

  2. • ࢯ໊ɿࢁຊ ४ • ॴଐɿ φΠϧגࣜձࣾ ϞϏϦςΟαʔϏεࣄۀ෦ • ΤϯδχΞྺɿ೥ •

    "84ར༻ྺɿ೥ • ࠷ۙͷझຯɿ Ϛʔέλʔͷ࠺ʹ42-Λڭ͑Δ͜ͱ ࣗݾ঺հ
  3. • "84"NQMJGZಋೖʹࢸΔ·Ͱ • "84"NQMJGZΛಋೖͯ͠Έ࣮ͨମݧ • "84"NQMJGZಋೖΛݕ౼͍ͯ͠Δํ΁޲͚ͯ ࿩͢͜ͱ

  4. "84"NQMJGZ ಋೖʹࢸΔ·Ͱ

  5. Πϯϑϥߏ੒ͷมԽ ୈߏ੒ ୈߏ੒ 8IBU`T /FYU αʔόʔӡ༻ αʔόϨεԽ ୈߏ੒

  6. ๊͍͑ͯͨ՝୊ʢੜ࢈ੑʣ • ࣮૷ͷଐਓతͳϒϨ • ϦϦʔεͷखؒ • Ұͭͷ֬ೝ؀ڥͷऔΓ߹͍

  7. ๊͍͑ͯͨ՝୊ʢ඼࣭ʣ • ӡ༻ͷΦϖϛεݮ • ϦϦʔεޙͷো֐ݮ

  8. ՝୊ղܾͷ伴 "84"NQMJGZ ୈߏ੒ ୈߏ੒ αʔόʔӡ༻ αʔόϨεԽ ୈߏ੒

  9. ಋೖͯ͠ΈͯͲ͏ʁ

  10. "NQMJGZ'SBNFXPSLͰαΫοͱόο ΫΤϯυϑϩϯτΤϯυ࣮૷ʂ import API from "@aws-amplify/api"; const awsconfig = require("./aws-exports").default;

    API.configure(awsconfig); const runAPI = async () => { return await API.get('TestAPI', '/api/test', {}); }; "NQMJGZ'SBNFXPSLͷ"1*Ϟδϡʔϧ ΛϑϩϯτͰར༻͠ɺαΫοͱ"1*࣮ߦ $ amplify init $ amplify api update $ amplify push ίϚϯυͰ-BNCEBؔ਺࡞੒ˍσϓϩΠ var express = require('express') var bodyParser = require('body-parser') var awsServerlessExpressMiddleware = require('aws-serverless-express/middleware') // declare a new express app var app = express() app.use(bodyParser.json()) app.use(awsServerlessExpressMiddleware.eventContext()) // Enable CORS for all methods app.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "*") res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept") next() }); /********************** * Example get method * **********************/ app.get('/api/test', function(req, res) { // Add your code here res.json({success: 'get call succeed!', url: req.url}); }); -BNCEB༻ͷ&YQSFTTϑϨʔϜϫʔΫͰ࣮૷
  11. .VMUJ&OWػೳͰෳ਺ͷ؀ڥߏஙՄೳʂ ։ൃऀ" ։ൃऀ# ։ൃऀ$ .VMUJ&OWJSPONFOU

  12. "NQMJGZ$POTPMFͰര଎$*$%ߏங ϒϥϯνߋ৽ͰσϓϩΠࣗಈԽʂ ຊ൪ "NQMJGZ$POTPMF $*$% 1VTINBTUFSCSBODI 1VTITUBHJOHCSBODI εςʔδϯά "NQMJGZ$POTPMF $*$%

  13. ੜ࢈ੑͷ՝୊શͯղܾʂ ü ࣮૷ͷଐਓతͳϒϨ ü ϦϦʔεͷखؒ ü Ұͭͷ֬ೝ؀ڥͷऔΓ߹͍ —"--(3&&/—

  14. ඼࣭՝୊͸গ͠վળʂ ü ӡ༻ͷΦϖϛεݮ "NQMJGZ$POTPMFͷ(JUIVC࿈ܞʹΑΓϦϦʔεΦϖϨʔγϣϯ͕ҰݩԽɻ • ϦϦʔεޙͷো֐ݮ ˞$ZQSFTTͰ&&ςετಋೖݕ౼͢Δ΋ɺ "NQMJGZ$POTPMFͷσϓϩΠ࣌ؒͷ౎߹ͰҰ୴தࢭɻ ରࡦݕ౼தɻɻɻ

  15. "84"NQMJGZ ΊͬͪΌ͑͑࢓ࣄ͠·͢΍Μʂ

  16. Ͱ΋ۤ೉΋͋Γ·ͨ͠ɻɻɻ

  17. ͸·ͬͨϙΠϯτᶃ ؀ڥผͷύϥϝʔλ౉͠ʹۤઓ "84"NQMJGZ όοΫΤϯυ ύϥϝʔλ ɾଞ"84Ϧιʔεͷ"3/ ɾ"1*ͷೝূΩʔ FUD ຊ൪ εςʔδϯά

    ։ൃ "84"NQMJGZ όοΫΤϯυ "84"NQMJGZ όοΫΤϯυ
  18. UFBNQSPWJEFSJOGPKTPO ͜ͷϑΝΠϧʹ؀ڥผύϥϝʔλ௥Ճ "NQMJGZ$POTPMFͰ ಈ͔ͳ͍ʂʁ (JUIVCʹίϛοτ ඞཁʂʁ ͸·ͬͨϙΠϯτᶃ ؀ڥผͷύϥϝʔλ౉͠ʹۤઓ

  19. ͸·ͬͨϙΠϯτᶃ 1BSBNFUFS4UPSFͰղܾʂ ຊ൪ εςʔδϯά ։ൃ 1BSBNFUFS 4UPSF "84"NQMJGZ όοΫΤϯυ "84"NQMJGZ

    όοΫΤϯυ "84"NQMJGZ όοΫΤϯυ ᶃύϥϝʔλ஋Λొ࿥ ᶄσϓϩΠ࣌ʹ ύϥϝʔλऔಘ
  20. ͸·ͬͨϙΠϯτᶄ ผܥ౷ͷ4όέοτͷར༻ʹۤઓ DBSNPKQ ը૾༻ 4όέοτ ϗεςΟϯά༻ 4όέοτ ը૾ߋ৽ όονॲཧ DBSNPKQ

    ը૾༻ 4όέοτ ϗεςΟϯά༻ 4όέοτ ը૾ߋ৽ όονॲཧ ඥ෇͚ෆՄ چߏ੒ ༧ఆ͍ͯͨ͠ߏ੒
  21. ͸·ͬͨϙΠϯτᶄ $MPVE'SPOUΛઌ಄ʹ௥ՃͰճආ DBSNPKQ ը૾༻ 4όέοτ ϗεςΟϯά༻ 4όέοτ ը૾ߋ৽ όονॲཧ ը૾༻

    4όέοτ ϗεςΟϯά༻ 4όέοτ ը૾ߋ৽ όονॲཧ DBSNPKQ ඥ෇͚Մೳ چߏ੒ ৽ߏ੒
  22. ͜ΕΛ཈͓͍͑ͯͯʂ ಋೖɾӡ༻ͷϙΠϯτ

  23. ಋೖɾӡ༻ϙΠϯτᶃ ద੾ͳͱ͜ΖͰ"NQMJGZΛར༻ ߴػೳͰ֦ுੑͷߴ͍ όοΫΤϯυͷߏங͕؆୯ "NQMJGZͰશͯߏங͸/( ˠංେԽʹΑΔอकੑͷ௿Լ

  24. ಋೖɾӡ༻ϙΠϯτᶃ ద੾ͳͱ͜ΖͰ"NQMJGZΛར༻ ϞόΠϧɾ ϑϩϯτΤϯυ αʔϏε αʔϏε ϞόΠϧɾϑϩϯτΤϯυ։ൃ ˠ"84"NQMJGZ ͦͷଞͷ։ൃ ˠ$MPVE'PSNBUJPOɺ"84

    $%, "84"NQMJGZͷ໨త ϞόΠϧɺϑϩϯτΤϯυ ͷ։ൃޮ཰ΛߴΊΔ $%/
  25. ಋೖɾӡ༻ϙΠϯτᶄ $MPVE'PSNBUJPOͷجૅΛֶΜͰ͓͘ $MPVE'PSNBUJPO "84"NQMJGZͷ جૅ͸$MPVE'PSNBUJPO "NQMJGZΛར༻͍ͯ͠Δͱʜ ɾόοΫΤϯυ։ൃͷτϥϒϧγϡʔςΟϯά ɾσϑΥϧτͷػೳʹύϥϝʔλͳͲઃఆ௥Ճ ˠ$MPVE'PSNBUJPOͷجૅΛ ஌͓ͬͯ͘ͱӡ༻ָ͕

  26. ಋೖɾӡ༻ϙΠϯτᶅ "84"NQMJGZͷखް͍αϙʔτΛར༻ (JUIVCͰΦʔϓϯʹ *TTVF؅ཧ͕͞Ε͍ͯΔ "84αϙʔτ΋׆༻

  27. None
  28. ͝ਗ਼ௌ ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ ΤϯδχΞɾͦͷଞ৬छେืूதʂ