我有以下代码:
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"
}
我尝试了几种变化,但似乎没有一种行得通。
我确定我错过了某些显而易见的东西。