YahooArchive / mojito

[archiving soon] Yahoo! Mojito Framework
BSD 3-Clause "New" or "Revised" License
1.57k stars 215 forks source link

[docs/code_ex] Updated steps and doc around `routes.json` in exs, removed one ex, updated another. #1364

Closed zhouyaoji closed 10 years ago

zhouyaoji commented 10 years ago

The steps in the example now use app.js for routing and sections regarding routing have been updated to discuss how to define routing paths in app.js. In addition, the binding example was updated so that it doesn't use the Url addon, which requires routes.json, and the generating_urls example was deleted as was its test.

caridy commented 10 years ago

Let's clarify about the url addon offline.

imalberto commented 10 years ago

/ping @caridy @zhouyaoji Hey guys, I've updated the wiki to include the additional app.map() that are required if app.js is registering routes outside of routes.json.

Remember that routes.json is sugar for now to actual app.get() and app.map() api calls. If needed, the application (preferably) can even provide their own wrapper around these calls for more complex configuration.

This is also mentioned in the HISTORY.md.

caridy commented 10 years ago

@imalberto that doesn't clarify on the url addon, is that still supported? if yes, how? It seems like it fails for @zhouyaoji

imalberto commented 10 years ago

@caridy The url add-on is still supported, and is used by both mojito-shaker and mojito-debug extensions. The url add-on relies on the routes being properly registered. I think looking at the examples, the routes are not registered via routes.json but in app.js. The matching app.map() calls should setup the right mapping for the url add-on to work.

zhouyaoji commented 10 years ago

@imalberto @caridy Great, I was able to use the Url addon after registering the routes with app.get. I'll update the documentation and add the generating_urls example/test again.

zhouyaoji commented 10 years ago

@imalberto @caridy I added and an updated generating_urls example/documentation, the tests, updated the file mojito_routing.rst to include how to make URLs w/ the Url addon and registering routes w/ app.map. See the last commit: 154edc2d84b39eb7500298d2539c075ea0f80a11