Skip to content

Instantly share code, notes, and snippets.

@tonyghita
Created February 10, 2016 15:39
Show Gist options
  • Save tonyghita/3c769475379d0994f415 to your computer and use it in GitHub Desktop.
Save tonyghita/3c769475379d0994f415 to your computer and use it in GitHub Desktop.
if (devMiddleware) {
app.get('*', (req, res) => {
res.write(devMiddleware.fileSystem.readFileSync(path.join(__dirname, '../..', 'build', 'index.html')))
res.end()
})
} else {
app.use(express.static(path.join(__dirname, '../..', 'build')))
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '../..', 'build', 'index.html'))
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment