Last active
December 10, 2015 22:58
-
-
Save deedubs/4505744 to your computer and use it in GitHub Desktop.
Catch-all for single page apps
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
// Catch-all for HTML5 content serving. | |
router.use(function (req, res, next) { | |
if (req.accepts(['text/html','application/json']) == 'text/html') | |
res | |
.sendfile('public/index.html', {maxAge: 60000}); | |
else | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment