Http-server: Support serving of Angular HTML5 mode projects

Created on 9 Sep 2016  路  2Comments  路  Source: http-party/http-server

I am serving an angular js project in development using the http-server and have HTML5 mode enabled so I can view URLs such as: localhost:8080/my-account/dashboard. This works fine for the most part until I need to refresh the page on any page that isn't the root page ( / ). For this to work the server needs to actually serve localhost:8080/index.html and let the app deal with the rest of the route.

Apache can do this with .htaccess / mod_rewrite. Is it possible that http-server could support a similar rewrite rule setup?

Most helpful comment

would something like the ws --spa index.html behaviour solve this and #80?

All 2 comments

would something like the ws --spa index.html behaviour solve this and #80?

Closing this in favor of a README update to show how to "self-proxy": https://github.com/indexzero/http-server/issues/338#issuecomment-460648032

Was this page helpful?
0 / 5 - 0 ratings

Related issues

isomorphisms picture isomorphisms  路  5Comments

jondlm picture jondlm  路  6Comments

ghost picture ghost  路  4Comments

ducklord picture ducklord  路  5Comments

JonFranchi picture JonFranchi  路  6Comments