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

SPAのホスティングと
Netlifyの話

 SPAのホスティングと
Netlifyの話

ng-kyoto Angular Meetup #8 の発表資料です。

Yosuke Onoue

October 06, 2018
Tweet

More Decks by Yosuke Onoue

Other Decks in Technology

Transcript

  1. 8FCͷτϨϯυ w ੩త8FCαΠτ w )5.-ɺ8FCαʔόʔ w ಈత8FCαΠτ w 1)1ɺ1ZUIPOɺ3VCZɺʜ w

    4JOHMF1BHF"QQMJDBUJPO 41"  w +BWB4DSJQUɺ3&45"1* w 1SPHSFTTJWF8FC"QQT 18"  w 41" Ћ ΑΓྑ͍69΁ ύϥμΠϜͷน w ൃ૝ͷҧ͍ w ։ൃํ๏ͷҧ͍
  2. -JHIUIPVTF w 8FCαΠτͷղੳπʔϧʢ$ISPNF֦ுPSίϚϯυʣ w 1SPHSFTTJWF8FC"QQ w 1FSGPSNBODF w "DDFTTJCJMJUZ w

    #FTU1SBDUJDFT w 4&0 w $ISPNF͔Βඪ४౥ࡌʢ"VEJUTQBOFMʣ w CZ(PPHMF
  3. w )5514 w Ϩεϙϯγϒ w ΦϑϥΠϯ w ϗʔϜը໘௥Ճ w ௿଎ճઢରԠ

    w Ϋϩεϒϥ΢βରԠ w εϜʔζͳϖʔδભҠ w ϖʔδຖͷ63- 18"$IFDLMJTU IUUQTEFWFMPQFSTHPPHMFDPNXFCQSPHSFTTJWFXFCBQQTDIFDLMJTU ϕʔεϥΠϯཁ݅ ໛ൣతͳ18" w ΠϯσοΫεՄೳ w 69 w ύϑΥʔϚϯε w Ωϟογϡ w ௨஌ w ͦͷଞ
  4. w )5514 w Ϩεϙϯγϒ w ΦϑϥΠϯ w ϗʔϜը໘௥Ճ w ௿଎ճઢରԠ

    w Ϋϩεϒϥ΢βରԠ w εϜʔζͳϖʔδભҠ w ϖʔδຖͷ63- 18"$IFDLMJTUͱϗεςΟϯά ϕʔεϥΠϯཁ݅ ໛ൣతͳ18" w ΠϯσοΫεՄೳ w 69 w ύϑΥʔϚϯε w Ωϟογϡ w ௨஌ w ͦͷଞ ϗεςΟϯά͸18"ͷཁ݅ͷଟ͘ʹؔΘΔ
  5. ࣗલ Ϩϯαό (JU)VC 1BHFT 'JSFCBTF /FUMJGZ 63-ϦμΠϨ Ϋτ ˓ ˚

    º ˓ ˓ )5514α ϙʔτ ˓ ˚ ˓ ˓ ˓ ΧελϜυϝ Πϯ ˓ ˚ ˓ ˓ ˓ ϓϦϨϯμϦ ϯά ˓ ˚ º º ˓ ߴ଎ ˚ ˚ ˓ ˓ ˓ ҆Ձ º ˚ ˓ ˓ ˓ ؆୯ º ˚ ˓ ˓ ˓
  6. %FNP  $ npm i -g @angular/cli $ ng new

    my-app $ cd my-app/ $ ng serve --open ΞϓϦͷ࡞੒
  7. %FNP  $ npm i -D netlify-cli@next $ npx netlify

    login $ ng build --prod $ npx netlify deploy -d dist/my-app /FUMJGZ΁ͷσϓϩΠ
  8. %FNP  $ ng add @angular/pwa --project my-app $ ng

    build --prod $ npm i -D http-server $ npx http-server -p 8080 -c-1 dist/my-app 18"ͷ༗ޮԽ
  9. "assets": [ "src/_redirects", "src/robots.txt", "src/favicon.ico", "src/assets", "src/manifest.json" ], BOHVMBSKTPO /*

    /index.html 200 http://ng-kyoto.netlify.com/* http://ng-kyoto.likr-lab.com/:splat 301! TSD@SFEJSFDUT <head> ... <base href="/"> <meta name="description" content="Demo for ng-kyoto Meetup #8 !"/> <meta name="viewport" content="width=device-width, initial-scale=1"> ... </head> TSDJOEFYIUNM User-agent : * Disallow : TSDSPCPUTUYU