ng serve
Builds and serves your application, rebuilding on file changes.
ng serve [project]
ng s [project]
Arguments
Argument | Description | Value Type |
---|---|---|
project |
The name of the project to build. Can be an application or a library. |
string |
Options
Option | Description | Value Type | Default Value |
---|---|---|---|
--allowed-hosts |
List of hosts that are allowed to access the dev server. |
array |
|
--browser-target |
A browser builder target to serve in the format of |
string |
|
--configuration |
One or more named builder configurations as a comma-separated list as specified in the "configurations" section in angular.json. The builder uses the named configurations to run the given target. For more information, see https://angular.io/guide/workspace-config#alternate-build-configurations. Aliases: -c |
string |
|
--disable-host-check |
Don't verify connected clients are part of allowed hosts. |
boolean |
false |
--help |
Shows a help message for this command in the console. |
boolean |
|
--hmr |
Enable hot module replacement. |
boolean |
false |
--host |
Host to listen on. |
string |
localhost |
--live-reload |
Whether to reload the page on change, using live-reload. |
boolean |
true |
--open |
Opens the url in default browser. Aliases: -o |
boolean |
false |
--poll |
Enable and define the file watching poll time period in milliseconds. |
number |
|
--port |
Port to listen on. |
number |
4200 |
--proxy-config |
Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server. |
string |
|
--public-host |
The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies. |
string |
|
--serve-path |
The pathname where the application will be served. |
string |
|
--ssl |
Serve using HTTPS. |
boolean |
false |
--ssl-cert |
SSL certificate to use for serving HTTPS. |
string |
|
--ssl-key |
SSL key to use for serving HTTPS. |
string |
|
--verbose |
Adds more details to output logging. |
boolean |
|
--watch |
Rebuild on change. |
boolean |
true |
© 2010–2022 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/cli/serve