rendrjs / rendr

Render your Backbone.js apps on the client and the server, using Node.js.
MIT License
4.09k stars 312 forks source link

allow routes to specify custom headers #462

Closed bigethan closed 9 years ago

bigethan commented 9 years ago

this PR has two motivations/changes:

  1. In order to modify our Content-Type header to specify a charset, we had to unchain the res.type('html') in getHandler() ( type'll overwrite anything that's already been set).
  2. Added a new attribute to the routes object headers to allow any headers to be passed in per route.
coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.04%) to 82.8% when pulling 3fbc2af0abf5dcd37ad1f0202531cd8d479e8215 on bigethan:moreHeaders into 5532a66de86bd64c20944276eccb5c87a59f902c on rendrjs:master.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.04%) to 82.801% when pulling 3fbc2af0abf5dcd37ad1f0202531cd8d479e8215 on bigethan:moreHeaders into 5532a66de86bd64c20944276eccb5c87a59f902c on rendrjs:master.

purusho commented 9 years ago

:+1:

crwang commented 9 years ago

I love this. Is there a way we can open up the Wiki so that we can document this as we add it?

bigethan commented 9 years ago

heh, I've already forked the rendrjs.github.io project :-) Was waiting to see if this went forward before writing it up.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.04%) to 82.8% when pulling 279dc1259f96b90f14a41aeec6960b4e54c6e7c4 on bigethan:moreHeaders into 5532a66de86bd64c20944276eccb5c87a59f902c on rendrjs:master.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.04%) to 82.8% when pulling 279dc1259f96b90f14a41aeec6960b4e54c6e7c4 on bigethan:moreHeaders into 5532a66de86bd64c20944276eccb5c87a59f902c on rendrjs:master.

saponifi3d commented 9 years ago

:D looks awesome - thanks @bigethan - let me know when you have a PR for rendrjs.github.io - or if you have any questions about the crazy that is that code #jekyll