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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -