Created
May 4, 2020 04:15
-
-
Save dhilt/c1863af8b34e8c697d77951689a78e05 to your computer and use it in GitHub Desktop.
Angular cli dev server port via .env // node script
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())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment