Renamed middleware

This commit is contained in:
Jori Lallo
2016-05-27 00:08:47 -07:00
parent a0f86f5ed4
commit 6f01ea6aa5

View 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();
}
}
};