firstandthird / hapi-method-loader

Hapi method loader
MIT License
0 stars 1 forks source link

Issue with deeply nested methods #11

Open dawnerd opened 8 years ago

dawnerd commented 8 years ago

Have a path: methods/facebook/formats

All methods inside fail to load with the error:

app_1  |     server.method(key, value.method.bind(server), value.options || {});
app_1  |                                    ^
app_1  |
app_1  | TypeError: Cannot read property 'bind' of undefined

Key is facebook.formats when it should be facebook.formats.<method name>

dawnerd commented 8 years ago

Looking at the lib, doesn't look like we support nested methods at all.

jgallen23 commented 8 years ago

https://github.com/firstandthird/hapi-method-loader/blob/master/test/module.test.js#L33 looks like we lost that and it was replaced with prefix. we should fix