javascript - Routes's conflicts between nodejs and angularjs -


i'm using nodejs, gulp , angular ui-router, , when configure angular remove tag (#) routes, next problem, angular's routes not works , navigator show message:

cannot /access

can limit nodejs responds calls under route?

e.g: localhost:3000/api/*

or need limit performance node , gulp ports.

the problem node.js attempting serve routes.

you can fix creatg catch-all handler runs after node.js routes (i.e. api calls, etc.).

assuming you're using express, in server.js file:

app = express(); app.use(app.router); // handles express routes  app.use(function(req, res) {   res.sendfile(__dirname + '/public/index.html'); // execute angular code }); 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -