Deploy Angular Build With Express JS Project
Deploy Angular Build in Node JS (Express JS) Server Mean Stack - Education Funda Firstly Create Angular Production Ready Build: ~ ng build (run in command line when directory is projectFolder). ~ Compress using Brotli compression the resources using the following command for i in dist/*/*; do brotli $i; done Deployment Check Angular Build: You can get a preview of your application using the ng serve --prod command that starts a local HTTP server such that the application with production files is accessible using http://localhost:4200. This is not safe to use for production usage. For a production usage, you have to deploy all the files from the dist folder in the HTTP server of your choice. Node JS/Express JS Server File Changes: //enabling CORS app . use ( cors ()); app . use ( express . static ( path . resolve ( './public' ))); //api v1 base route set app . use ( '/api/v1' , router ); //angular front site app . use ( express . static ( path . resolve ( './public/a...