Marak / webservice.js

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

Implement issue #28, replace JS based views consturction with Weld and JS #33

Open syrio opened 13 years ago

syrio commented 13 years ago

An attempt at implementing https://github.com/Marak/webservice.js/issues/28

Added jquery.min.js and weld.min.js to the views directory without trying to do anything npm based for resolving these dependencies, if this is a problem please correct me.

While working on this fix I couldn't help but notice that there seems to be inconsistencies with the way webservice.js is expected to behave when asked to expose nested functions. The _extendRouter function in lib/createRouter works only on functions that have one level of nested functions as external properties and doesn't work with objects at all. This contradicts with sample_modules/complexModule.js and made lib/view.js break and not generate documentation for the nested functions.

The fix tried to go around it and introduced the "name" property as a mean to solving this issue, even just for generating correct documentation for nested method, even though there aren't any valid journey routes for them. Changing createRouter was out of scope for this fix.

Cheers!