0

In the quickstart demo of Angular 2 the lite server is listening to the port 3000.

I don't understand why the request is sent to the port 3000 when the application is launched. Where is this value assigned? Is it possible to change it?

user1643352
  • 2,635
  • 2
  • 19
  • 25
  • Refer this - http://stackoverflow.com/questions/35516783/how-can-you-specify-ui-port-for-lite-server – Sanket Jul 09 '16 at 12:48

1 Answers1

0

Yes, you can change the port via a bs-config.json file, which allows you to specify the port, the default browser and other parameters.

Details here: https://github.com/johnpapa/lite-server

hholtij
  • 2,906
  • 6
  • 27
  • 42
  • Thanks, it works (I put bs-config.json in the root directory of the project and it contains { "port": 8000 }),. But I don't understand why changing the port of lite-server changes the port of the request. What does bootstrap exactly and what is the link between bootstrap and lite-server? I am new with Angular 2 and I have certainly a lot ot things to understand... – user1643352 Jul 10 '16 at 10:11
  • Lite-server is independent of Angular and the bootstrap process. It is just a light server for dev purposes that knows nothing about the dev environment and is therefore independent of it. There is no request. Lite-server simply serves the page at the requested port. The bootstrap process is too involved to explain in a comment. Search for it and read. It may take a moment to comprehend but it's good to know. – hholtij Jul 10 '16 at 12:05
  • Except from https://angular.io/docs/ts/latest/api/platform-browser-dynamic/index/bootstrap-function.html, (not for a novice with Angular 2) where can I find information about bootstrap? – user1643352 Jul 11 '16 at 09:36