我正在尝试为资源创建自定义地图,
app.namespace('/v1', function(){
var sessionResource = app.resource('session', require('./routes/v1/session'));
sessionResource.map('/test', sessionResource.index);
});
地图中断如下,但是没有自定义地图,ns和资源可以顺利工作
/home/kuryaki/piitri/newApi/node_modules/express-resource/index.js:125
if ('/' == path[0]) path = path.substr(1);
^
TypeError: Cannot read property '0' of undefined
at Resource.map (/home/kuryaki/piitri/newApi/node_modules/express-resource/index.js:125:18)
at HTTPServer.<anonymous> (/home/kuryaki/piitri/newApi/app.js:44:31)
at HTTPServer.exports.namespace (/home/kuryaki/piitri/newApi/node_modules/express-namespace/index.js:31:6)
at Object.<anonymous> (/home/kuryaki/piitri/newApi/app.js:42:5)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
index 方法存在这就是我实际测试它的方式
在 localhost 获取 /v1/session
我已经尝试使用节点 v0.6.14、v0.8.4 和 v0.9.0pre 并且没有工作我做错了什么?