Razzle: SSR - running server at User defined port and host.

Created on 15 Sep 2017  ·  3Comments  ·  Source: jaredpalmer/razzle

Hi,

Can you please help me in overriding the default port and host while running the server using
Environment variables (process.env.PORT ) and where I suppose to make the changes.

Thanks,
Goutham KD

All 3 comments

https://github.com/jaredpalmer/razzle#environment-variables

As mentioned below, add PORT=1313 etc to your .env file

Can you try checking out the readme before asking your question next time?
Might save you some time next time.

It worked for me. See the original issue: 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'));
Was this page helpful?
0 / 5 - 0 ratings

Related issues

kkarkos picture kkarkos  ·  3Comments

MaxGoh picture MaxGoh  ·  4Comments

ewolfe picture ewolfe  ·  4Comments

Jayphen picture Jayphen  ·  4Comments

jcblw picture jcblw  ·  4Comments