We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4afb19 commit 614ec82Copy full SHA for 614ec82
packages/lit-dev-server/src/middleware/redirect-middleware.ts
@@ -11,6 +11,13 @@ import type Koa from 'koa';
11
* Creates a Koa middleware that performs lit.dev redirection logic.
12
*/
13
export const redirectMiddleware = (): Koa.Middleware => async (ctx, next) => {
14
+ if (ctx.host === 'www.lit.dev') {
15
+ const url = new URL(ctx.URL);
16
+ url.hostname = 'lit.dev';
17
+ ctx.status = 301;
18
+ ctx.redirect(url.href);
19
+ return;
20
+ }
21
// If there would be multiple redirects, resolve them all here so that we
22
// serve just one HTTP redirect instead of a chain.
23
let path = ctx.path;
0 commit comments