Server For Angularjs App

Working on my Finance App I wanted the website to be a standalone JS application for which I am using AngularJS. To make that happen I needed a simple server to deliver the necessary javascript, css and html files that make up the javascript application to the client (browser).

So I decided to make use of Werkzeug and ended up with the following straight forward python code to deliver the application code.

I wanted to stick with the angular-seed application format/layout of code and so the static files are delivered via the SharedDataMiddleware with the relevant paths defined there.

HTML files are delivered in the normal manner. A couple of improvements could be to only allow .html files and robots.txt files. It’s still early days in the development of this project, so things may change as I learn more.


139 Words

2013-01-23 19:00 -0500