Using Custom Ports in Development
For using custom ports in your application, you can either
- Add a
PORTkey in your.envfile. - Pass the
PORTenvironment variable through the command line.
Add to .env file
PORT=8000
Pass PORT via command line
Windows (cmd.exe)
set PORT=8000&&npm start
(Note: the lack of whitespace is intentional.)
Windows (Powershell)
($env:PORT = "8000") -and (npm start)
Linux, macOS (Bash)
PORT=8000 npm start
To avoid having to set the environment variable each time, you can either include in the npm start script like so:
{
"start": "PORT=8000 kvell-scripts start"
}
