Redirect home page traffic to unpkg.com

This commit is contained in:
Michael Jackson 2016-09-12 14:07:46 -07:00
parent ae1eb0d2f3
commit 855988865d
1 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,11 @@ const fetchStats = (callback) => {
}
export const sendHomePage = (req, res, next) => {
if (req.hostname === 'npmcdn.com') {
res.redirect(301, 'https://unpkg.com' + req.originalUrl)
return
}
const chunks = [ 'vendor', 'home' ]
const props = {
styles: req.bundle.getStyleAssets(chunks),