0
我試圖創造資源的自定義地圖,快遞命名空間和表達資源不會允許地圖
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)
索引方法存在,這是我實際上如何在本地主機測試它
GET/V1 /會話
我已經試過節點v0.6.14,v0.8.4和v0.9.0pre,沒有工作我做錯了什麼?