Redirect home page traffic to unpkg.com
This commit is contained in:
parent
ae1eb0d2f3
commit
855988865d
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue