Last active
November 28, 2016 06:04
-
-
Save patrickdawson/49d3b42eed3f5c35bbdddad3995b3815 to your computer and use it in GitHub Desktop.
Express-Angular: Catch 404
This file contains 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
// 404 catch | |
app.all('*', (req, res) => { | |
console.log(`[TRACE] Server 404 request: ${req.originalUrl}`); | |
res.status(200).sendFile(`${path.join(__dirname, 'public')}/index.html`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment