A combination of AngularJS, HTML5 locations and superstatic

I use nodejs http server to serve my Angular application, but it doesn’t work well with HTML5 locations because they require server redirection and the http server doesn’t do that. Therefore, I saw a recommendation to try superstatic and install it. Then I installed the following superstatic.json file:

{
  "routes": {
    "Admin/**":"/index.html",
    "Give/**":"/index.html",
    "Pending/**":"/index.html",
    "Store/**":"/index.html"
  }
}

I launched it with

superstatic --config superstatic.json

While it is serving my application correctly, if I start with "/", it reloads the index.html file but does not process the Angular file.

Has anyone successfully used superstatics with angular?

+4
source share
2

, superstatic.json :

{
  "rewrites": [
    {"source":"/**","destination":"/index.html"}
  ]
}

superstatic --config superstatic.json
+6

superstatic.json AngularJS HTML5.

{
    "routes": [
    {"**": "index.html"}
    ]
}

, .

+1

All Articles