现在做了一个应用,都是纯后端提供数据。所以用了angular的路由,现在要导出excel。我想用nodejs去取得路由,然后做功能。现在是angular的路由感觉不跟express一样
var http = require('http');
var url = require("url");
var express = require('express');
var app = express();
app.use(express.static(__dirname+'/app')); //所有的静态页面和资源
app.use(function(req,res,next){
console.log(123);
next();
})
http.createServer(app).listen(3000, function(){
console.log('Server start at port 3000')
})
现在123是打印不出来,因为路由都在前端的angular。怎么做啊,救命啊。。。。
You haven’t written the route yet. What connection do you want to access?
For example get root directory /
Add the following methods:
Then visit with your browser:
localhost:3000
Node cannot get Angular’s route. Angular does it on the client side. You can get it from location.hash and submit it to the backend