i am trying to change the default "4200" port.
I tried adding the bs-config.json under src like this:
{
"port": 9002,
"files": ["./src/**/*.{html,htm,css,js}"],
"server": { "baseDir": "./src" }
}
but it did not work. Moreover i searched in my whole project for port 4200 but i did not find the real configuration.
Please help me with this .
Thanks.
UPDATE
i added .ember-cli file in project root with custom port :
{
"port": 9002
}
and it works.
答案 0 :(得分:4)
Depends on what server software you're using, but based on your port and configuration it's most likely one of these:
Angular2-cli
If you are using something like
ng serve
You are using angular2-cli, and need to provide at port argument like so:
ng serve --port 9002
Source: https://github.com/angular/angular-cli#usage
lite-server
If you're using lite-server, your configuration looks correct, so ensure the configuration is loaded at startup. The console output normally says something like 'couldn't find bs-config.json, using default settings'
答案 1 :(得分:4)
"defaults": {
"styleExt": "css",
"component": {},
"serve": {
"port": 8080
}
}