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

NestJSを活用したREST APIサーバ/REST_API_SERVER_BY_NESTJS

Masahiko Sakakibara
November 29, 2019
1.3k

NestJSを活用したREST APIサーバ/REST_API_SERVER_BY_NESTJS

Masahiko Sakakibara

November 29, 2019
Tweet

More Decks by Masahiko Sakakibara

Transcript

  1. ཧ૝ͷੈք όοΫΤϯυ \n^ \ OBNFTUSJOH EFTDTUSJOH JNBHFTUSJOH VSMTUSJOH ^<> ͰσʔλΛૹΔˠ

    ϑϩϯτΤϯυ \n^ \ OBNFTUSJOH EFTDTUSJOH JNBHFTUSJOH VSMTUSJOH ^<> Ͱσʔλ͕ཉ͍͠ ˡ
  2. ͡Ό͋Ͳ͏΍ͬͯܕΛڞ༗͢Δʁʁ όοΫΤϯυ \n^ ϑϩϯτΤϯυ \n^ Ͳ͏΍ͬͯܕΛڞ༗ʁ OQNύοέʔδʹ͢Δ ˕ ཧ૝తɻͨͩ͠อक͕खؒɻ /FTU+4ͷϓϩδΣΫτʹ

    ஔ͘ ̋ ݱ࣮తɻϑϩϯτΤϯυ͔Β͸
 webpackͰόϯυϧ ϓϩδΣΫτ֎ʹ͓͘ ˚ tscίϚϯυͷઃఆΛཁมߋʢະௐࠪʣ
  3. ৗʹΞΫηε͕͋Δͱ͸ݶΒͳ͍ load() { if (this.data) { return of(this.data); } else

    { return this.http.get<IDataJson>(‘https://example.com‘)
 .pipe(map(this.processData, this)); } } ϝϞϦ΍ετϨʔδΛ ׆༻ͨ͠Γ FϥʔχϯάΈ͍ͨʹ සൟͳ"1*ߋ৽͕ͳ͍
  4. ࢖͍ํ $ npm install serverless -g $ git clone [email protected]:rdlabo/serverless-nestjs.git

    ʲprojectNameʳ Πϯετʔϧ ։ൃ $ npm start -BNCEB)PUTUBSUαϙʔτ 4XBHHFSαϙʔτ $ npx ts-node src/swagger.ts