isaacs / templar

A lightweight template thing for node http servers
ISC License
36 stars 9 forks source link

Would be nice to have an option to write the template to the response without ending it #6

Closed AndrewSwerlick closed 11 years ago

AndrewSwerlick commented 11 years ago

I'm writing a small webapp with node and templar, and playing with logging debugging messages at the bottom of the page when running in testing mode. My thought process was to centralize this logging in one place, but it's made difficult by the fact that templar both writes to and ends the response. If we could pass in a boolean to the template function specifying whether or not templar should end the response, that'd be great. I'll attach a pull request where I've taken a crack at the enhancement.

isaacs commented 11 years ago

Sounds reasonable. Maybe there should be an option { end: false } that you pass to the templar initialization, and then it's on you to call res.end() at some point.

isaacs commented 11 years ago

Done on 0.2.0