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),