Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Express + Webpack Dev Server
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