Test Angular Build Locally
(Source/Credits: https://dev.to/leonelngande/test-angular-build-locally-2249)
To test your Angular build locally: Build your app: ng build --prod Install http-server for...
title: Test Angular Build Locally published: true tags: Angular canonical_url: https://www.leonelngande.com/test-angular-build-locally/
To test your Angular build locally:
- Build your app:
ng build --prod
- Install http-server for serving the app:
npm i -g http-server
- cd (change directory) into the the build location and run the app with:
http-server
- Open http-server url appending /index.html to it, should look something like this
http://127.0.0.1:8080/index.html
🎉
Comments section
engahmedshehatah
•May 1, 2024
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.
rplaurindo
•May 1, 2024
Thank so much. It works.