Created
September 23, 2015 15:03
-
-
Save nickdima/e4b657d47f3693dd3313 to your computer and use it in GitHub Desktop.
Express + Webpack Dev Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if process.env.NODE_ENV is 'development' | |
app.all /(^\/(js|css)\/(.+))|(hot-update\.(.+)$)/, (req, res, next) -> | |
url = 'http://localhost:3001' + req.originalUrl | |
callback = (error, response, body) => | |
if body? | |
res.writeHead response.statusCode, response.headers | |
res.end(body) | |
else | |
next() | |
request(url, callback) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment