YahooArchive / mojito

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

Routes exposed to the client #1381

Closed aljimenez closed 10 years ago

aljimenez commented 10 years ago

Now that routes.json is no longer contextualized, there is no way to specify which routes can be made available to the client runtime. As a result all routes are visible on the client side, which adds to the size of the page and exposes internals.

caridy commented 10 years ago

This is supported thru express-annotations: https://github.com/yahoo/express-annotations#appfindallannotations

You can add specific marks into each route, (e.g.: client: true), then expose the result of the app.findAll() operation overruling the mojito default behavior, which is expose everything.

aljimenez commented 10 years ago

See this pull request