This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEV_SERVER_PORT=4201 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "my-angular-project", | |
"scripts": { | |
"start": "node run-env" | |
}, | |
"devDependencies": { | |
"dotenv": "^8.2.0" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dotenv = require('dotenv'); | |
const child_process = require('child_process'); | |
const config = dotenv.config() | |
const DEV_SERVER_PORT = process.env.DEV_SERVER_PORT || 4200; | |
const child = child_process.exec(`ng serve --port=${DEV_SERVER_PORT}`); | |
child.stderr.on('data', err => console.error(err)); | |
child.stdout.on('data', data => console.log(data.toString())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEV_SERVER_PORT=4201 |