Skip to content

rieulp/coffee_shopping_spa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f94f6b7 ยท Oct 21, 2022

History

57 Commits
Oct 21, 2022
Sep 6, 2022
Sep 21, 2022
Sep 21, 2022
Sep 21, 2022
Sep 21, 2022
Sep 21, 2022
Sep 19, 2022
Oct 21, 2022
Sep 21, 2022
Sep 21, 2022

Repository files navigation

Vanilla TypeScript๋กœ SPA ๊ตฌํ˜„ํ•˜๊ธฐ

  • Express, vanilla typescript, history API, Webpack ์‚ฌ์šฉ
  • SPA ๋ผ์šฐํŒ… ์‹œ์Šคํ…œ ๊ตฌํ˜„

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ๊ณผ์ œํ…Œ์ŠคํŠธ ์ปคํ”ผ ์ฃผ๋ฌธ ํŽ˜์ด์ง€ ๋งŒ๋“ค๊ธฐ ํ™œ์šฉ

npm scripts

๋นŒ๋“œ

npm run build

๊ฐœ๋ฐœ์„œ๋ฒ„ ์‹คํ–‰

npm run dev

์‹คํ–‰

npm run start

proxy server

ํ”„๋กœ์ ํŠธ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์š”์ฒญํ•  ๋•Œ ๋™์ผ ์ถœ์ฒ˜ ์ •์ฑ…(๋™์ผํ•œ ์ถœ์ฒ˜์˜ ๋ฆฌ์†Œ์Šค์—๋งŒ ์ ‘๊ทผํ•˜๋„๋ก ์ œํ•œํ•˜๋Š” ๊ฒƒ)์œผ๋กœ CORS ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.

์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ์œ„ํ•ด express๋กœ ๊ฐ„๋‹จํ•œ proxy server๋ฅผ ๋งŒ๋“ค์—ˆ๋‹ค (server.js ํŒŒ์ผ)

  • CORS(Cross Origin Resource Sharing)

    CORS๋Š” ํ•œ ๋„๋ฉ”์ธ ๋˜๋Š” Origin์˜ ์›น ํŽ˜์ด์ง€๊ฐ€ ๋‹ค๋ฅธ ๋„๋ฉ”์ธ (๋„๋ฉ”์ธ ๊ฐ„ ์š”์ฒญ)์„ ๊ฐ€์ง„ ๋ฆฌ์†Œ์Šค์— ์•ก์„ธ์Šค ํ•  ์ˆ˜ ์žˆ๊ฒŒํ•˜๋Š” ๋ณด์•ˆ ๋ฉ”์ปค๋‹ˆ์ฆ˜