0
我试图验证用户,当他请求一些具有静态路由的页面时。关于静态文件快递的权限路由JS
app.use(express.static(__dirname + '/public/app');
假设该文件夹的“模板”是上面(“/公共/应用/模板”)的路径下:
app.get('/templates/permissionPage.html',function(req,res){
// if user is authorized.. reutrn the page,
else return 401..
});
我的路由,即使不进入页面的GET请求。我如何处理该请求? 我希望只有特定的用户才能访问此页面,尽管他获得了静态路由。
我使用我的前端angularJS
谢谢