【发布时间】:2017-02-09 04:07:47
【问题描述】:
我已经通过http://hapijs.com/tutorials/serving-files
但这并没有帮助我。
我在项目根目录的静态目录中有一个文件a.js。
我已将relativePath 配置为胶水配置为项目根目录中的inert 插件。
plugins: {
'vision': {},
'inert': {
routes: {
files: {
relativeTo: Path.join(__dirname, 'static')
}
}
},
'visionary': {
engines: {
// other plugins
我的服务器路由如下:
{
method: 'GET',
path: '/a.js',
handler: {
file : 'a.js'
}
}
但是当我尝试访问 http://localhost:3000/a.js 时,它会抛出 404 错误。
我错过了什么?
【问题讨论】: