From 855988865dc870f1545e99e923d9ae99bd3edb8b Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Mon, 12 Sep 2016 14:07:46 -0700 Subject: [PATCH] Redirect home page traffic to unpkg.com --- modules/server/MainController.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/server/MainController.js b/modules/server/MainController.js index cc69645..05a4c56 100644 --- a/modules/server/MainController.js +++ b/modules/server/MainController.js @@ -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),