This MEAN sample, ng serve
starts the app fine at port 4200 but can't fetch data as Fiddler shows it fails calling an API at port 3000.
How to start npm alongside ng?
/package.json
"name": "awesome-bucketlist",
"version": "1.0.0",
"description": "A simple bucketlist app using MEAN stack",
"main": "app.js",
"scripts": {
"start": "node app"
}
/angular-src/package.json:
{
"name": "angular-src",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
}
launch.json
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000/bucketlist",
"webRoot": "${workspaceFolder}/app.js"
}
In your package.json, you can chain commands together using
&&
.Ex: