![](/img/trans.png)
[英]Express.js: Specifying a root route breaks static file resolvement
[英]Permission route on static file express JS
当他请求具有静态路由的页面时,我正在尝试对用户进行身份验证。
app.use(express.static(__dirname + '/public/app');
假设文件夹“模板”位于上面的路径('/ public / app / templates')下:
app.get('/templates/permissionPage.html',function(req,res){
// if user is authorized.. reutrn the page,
else return 401..
});
我的路由甚至不输入页面的获取请求。 如何处理该请求? 我希望只有特定用户才能访问此页面,尽管他获得了静态路由。
我在前端使用angularJS
谢谢
您有两种选择:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.