【发布时间】:2014-02-11 13:13:35
【问题描述】:
我正在尝试使用以下代码通过 restify 提供静态文件。
app.get(/.*/, restify.serveStatic({
directory: __dirname + '/public',
default: 'index.html'
}));
调用 GET / 或 GET /index.html 按预期工作。 调用 public 子目录中的任何文件都不起作用。 例如调用 GET /css/style.css 会导致 404。 文件存在但未被提供。
有什么想法吗?
【问题讨论】: