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

howardya picture howardya  路  5Comments

krazyjakee picture krazyjakee  路  3Comments

gabimor picture gabimor  路  3Comments

JacopKane picture JacopKane  路  3Comments

charlie632 picture charlie632  路  4Comments