Last active
December 10, 2015 00:28
-
-
Save csusbdt/4351124 to your computer and use it in GitHub Desktop.
Node express request handler that returns Facebook channel.html with one-year expiration.
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
// Return Facebook channel.html with one-year expiration. | |
app.get('/channel.html', function(req, res) { | |
var channelDoc = '<script src="//connect.facebook.net/en_US/all.js"></script>'; | |
res.set({ | |
'Content-Type': 'text/html', | |
'Content-Length': channelDoc.length, | |
'Pragma': 'public', | |
'Cache-Control': 'max-age=31536000', | |
'Expires': new Date(Date.now() + 31536000000).toUTCString() | |
}); | |
res.end(channelDoc); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment