์๋ ,
๋ค์์ ์ฌ์ฉํ์ฌ ์๋ฒ๋ฅผ ์คํํ๋ ๋์ ๊ธฐ๋ณธ ํฌํธ์ ํธ์คํธ๋ฅผ ์ฌ์ ์ํ๋ ๋ฐ ๋์์ ์ฃผ์๊ฒ ์ต๋๊น?
ํ๊ฒฝ ๋ณ์(process.env.PORT) ๋ฐ ๋ณ๊ฒฝํด์ผ ํ ์์น.
๊ฐ์ฌ ํด์,
๊ตฌ๋ด KD
https://github.com/jaredpalmer/razzle#environment -๋ณ์
์๋์ ์ธ๊ธ๋ ๋๋ก .env
ํ์ผ์ PORT=1313
๋ฑ์ ์ถ๊ฐํ์ญ์์ค.
๋ค์์ ์ง๋ฌธํ๊ธฐ ์ ์ Readme๋ฅผ ํ์ธํด ์ฃผ์๊ฒ ์ต๋๊น?
๋ค์์ ์๊ฐ์ ์ ์ฝํ ์ ์์ต๋๋ค.
๊ทธ๊ฒ์ ๋๋ฅผ ์ํด ์ผํ์ต๋๋ค. ์๋ณธ ๋ฌธ์ ์ฐธ์กฐ: https://github.com/jaredpalmer/razzle/issues/356
// This will extract the env during production execution.. PORT will not be inlined during build
const getEnv = c => process.env[c];
app.listen(getEnv('PORT'));