Renamed middleware
This commit is contained in:
12
server/middlewares/subdomainRedirect.js
Normal file
12
server/middlewares/subdomainRedirect.js
Normal file
@ -0,0 +1,12 @@
|
||||
export default function subdomainRedirect(options) {
|
||||
return async function subdomainRedirectMiddleware(ctx, next) {
|
||||
console.log(ctx.headers);
|
||||
|
||||
if (ctx.headers.host === 'beautifulatlas.com') {
|
||||
ctx.redirect('https://wwww.' + ctx.headers.host + ctx.path);
|
||||
}
|
||||
else {
|
||||
return next();
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user