lukeed / sirv

An optimized middleware & CLI application for serving static files~!
MIT License
1.07k stars 58 forks source link

new get-port version breaks when using ENV var to set port #164

Open pixeldrew opened 2 weeks ago

pixeldrew commented 2 weeks ago

When setting env var PORT="8080"

New version of get-port expects an integer as an argument and returns an integer instead of a string. So when opts.port is set as an env var the value, it does not get converted to an integer and get-port gives you a different random port.

The way to correct this would be to convert the process.env PORT value to integer before sending it to get-port

pixeldrew commented 2 weeks ago

This has broken our build since we didn't pin the sirv-cli version.

pixeldrew commented 1 week ago

@lukeed any chance you can take a look at this?