Marak / webservice.js

## Project deprecated, Use flatiron/restful instead
252 stars 24 forks source link

Multiple modules #21

Closed hillmark closed 13 years ago

hillmark commented 13 years ago

https://github.com/Marak/webservice.js/issues/14

Is there any chance of an example of how to implement the multiple module solution suggested in issue 14? I've tried it various ways, but my methods are never exposed, only the module name, e.g:

http://www.example.com/module_name/ instead of:

http://www.example.com/module_name/method_name

Thanks.

Marak commented 13 years ago

I'll see what I can do about this in the upcoming week.

Marak commented 13 years ago

Okay, so I think if you just fix this to be recursive it will work: https://github.com/Marak/webservice.js/blob/master/lib/createRouter.js#L68

It's just iterating through the first level of exports, just make it a recursive traverse and it should do the trick. It should't be to hard of a code change. You might be able to snag some ideas from https://github.com/substack/js-traverse or just use it as a dep.

Marak commented 13 years ago

Bump.

hillmark commented 13 years ago

Thanks for taking a look at this.

Certainly looks like a solution, which I'll bear in mind for future reference.