【发布时间】:2014-09-08 20:39:41
【问题描述】:
我使用 node.js 和 express 作为路由方法,我的路由看起来像:
Set the website routes
app.use('/public', express.static('./public'));
app.use('/web', express.static('./web'));
如何在一种方法中设置对“public”和“web”文件夹的限制访问,目前我使用的是两行代码
app.get('/public*', checkPermissions, function(req,res,next){ next(); });
app.get('/web*', checkPermissions, function(req,res,next){ next(); });
【问题讨论】:
标签: javascript node.js express