http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Should Read PORT property from process.env.PORT

Open shubhamdeodia opened this issue 3 years ago • 4 comments

Environment Versions

  1. OS Type : MacOS
  2. Node version: v16.9.1
  3. http-server version: 14.0.0

Steps to reproduce

Before Running this script, I have already set env variable and verified that variable is accessble on process.env.PORT "local:prod": "npm run build && http-server ./build --cors",

Expected result

It should get the port number from process.env.PORT ...

Actual result

It automatically assigns a random PORT

...

Other information

shubhamdeodia avatar Nov 24 '21 07:11 shubhamdeodia

How did you verify that process.env.PORT is set correctly?

thornjad avatar Dec 06 '21 20:12 thornjad

@thornjad

I checked it within my webpack config file. console.log(process.env.PORT)

shubhamdeodia avatar Dec 07 '21 07:12 shubhamdeodia

any solution to this problem how can I pass environment variables from a file?

ars2062 avatar Jan 10 '22 09:01 ars2062

This issue has been inactive for 180 days

github-actions[bot] avatar Jul 09 '22 12:07 github-actions[bot]