mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
bf45e97641
* Update types * fix circular dep * type imports * lint type imports and --fix
12 lines
321 B
TypeScript
12 lines
321 B
TypeScript
import type { Context, Next } from "koa";
|
|
|
|
export default function apexRedirect() {
|
|
return async function apexRedirectMiddleware(ctx: Context, next: Next) {
|
|
if (ctx.headers.host === "getoutline.com") {
|
|
ctx.redirect(`https://www.${ctx.headers.host}${ctx.path}`);
|
|
} else {
|
|
return next();
|
|
}
|
|
};
|
|
}
|