Python Flask and Angular 6 integration Python Flask and Angular 6 integration flask flask

Python Flask and Angular 6 integration


You will have to build the Angular project and serve it to Flask. Useng build to build the Angular project. This creates a folder named dist which contains javascript codes which are compiled from your typescript codes, css codes and index.html. To serve these to Flask, copy the generated static scripts(js and css) to static folder and the generated index.html to templates folder of your Flask project.

For production mode, use ng build --prod to build the Angular project. ng build --prod creates a dist.rar file which on unzipping gives the same dist folder as mentioned above. Then follow the same procedure as mentioned above.