我有以下代码:服务与的RESTify(node.js的)静态文件
app.js
[...]
server.get(/\/docs\/public\/?.*/, restify.serveStatic({
directory: './public'
}));
server.listen(1337, function() {
console.log('%s listening at %s', server.name, server.url);
});
而且我有以下文件结构
app.js
public/
index.html
所以我尝试浏览:
http://localhost:1337/docs/public/index.html
我得到
{
code: "ResourceNotFound",
message: "/docs/public/index.html"
}
我尝试了几个变化,但没有一个似乎工作。
我敢肯定,这应该是整个路线路径东西很明显我缺少
我寻找可喜的文件记录。 – 2014-06-10 22:38:58