DEV Community

Leonel Elimpe
Leonel Elimpe

Posted on • Originally published at leonelngande.com on

Test Angular Build Locally

To test your Angular build locally:

  1. Build your app: ng build --prod
  2. Install http-server for serving the app: npm i -g http-server
  3. cd (change directory) into the the build location and run the app with: http-server
  4. Open http-server url appending /index.html to it, should look something like this http://127.0.0.1:8080/index.html

🎉

Top comments (2)

Collapse
 
engahmedshehatah profile image
Ahmed Shehatah

Thanks for the amazing solution.

I faced a problem accessing the URL"127.0.0.1:8080/index.html" or accessing "127.0.0.1:8080"
So, to solve this I used the proxy option "http-server --proxy localhost:8080?"
And it is working fine.

Collapse
 
rplaurindo profile image
Rafael Pereira

Thank so much. It works.