Angular CLI Basics - ng serve


ng serve is a great command to use when developing your application locally. It starts up a local development server, which will serve your application while you are developing it. It is not meant to be used for a production environment.

While the server is running, it will automatically reload if a file is changed, making the development process quick and easy.

We talk about two flags that you can use with this command. They are:

  • --port: This flag allows you to change the port on which the application runs. The default port is 4200, and can remain that way if you'd like.
  • --open, or -o: After the application is built and the development server started, the application opens in your default browser on the correct port

There are some other flags that you can use. If you'd like to check out a complete list, check out the documentation.