linemanjs / lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change
MIT License
1.18k stars 83 forks source link

What is the best way to add a http header in the express server response? #349

Closed rsbrodie closed 9 years ago

rsbrodie commented 9 years ago

I would like to add an http header in the express server response. What is the best way to do this in LinemanJS? Is there an entry that can be made in the config/server.js file?

davemo commented 9 years ago

Hi @rsbrodie, you can modify config/server.js and leverage any of the express APIs to make changes to the request and/or response objects. Here's an example in a Lineman project where I modify headers to add CSRF token information for Angular:

https://github.com/davemo/practical-angularjs/blob/master/codemash/finish/config/server.js#L19-L36