0

using lite-server (Angular2 docs) my angular application runs perfectly but using node-static the manual navigation does not work.

For example if I manually write localhost/404 using lite-server I can see my 404 page, but if I serve the application using node-static I get a blank page.

The console remains empty, so I really don't understand the cause.

This is my node-static server code:

var nodeStatic = require('node-static');
var file = new nodeStatic.Server('wwwroot');

require('http').createServer(function (request, response) {
    request.addListener('end', function () {
        file.serve(request, response);
    }).resume();
}).listen(2035);

Thanks a lot!

user3471528
  • 3,013
  • 6
  • 36
  • 60

1 Answers1

0

You need either to use a server that redirects to the entry point or use LocationStrategy HashLocationStrategy instead of the default PathLocationStrategy.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567