tangled
alpha
login
or
join now
openstatus.dev
/
openstatus
6
fork
atom
Openstatus
www.openstatus.dev
6
fork
atom
overview
issues
pulls
pipelines
chore: custom domain rewrite
Maximilian Kaske
5 months ago
9c527cd4
6617d717
+4
-1
2 changed files
expand all
collapse all
unified
split
apps
status-page
src
middleware.ts
web
next.config.js
+3
apps/status-page/src/middleware.ts
···
16
16
17
17
const hostnames = host?.split(/[.:]/) ?? url.host.split(/[.:]/);
18
18
const pathnames = url.pathname.split("/");
19
19
+
20
20
+
console.log({ hostnames, pathnames });
21
21
+
19
22
if (
20
23
hostnames.length > 2 &&
21
24
hostnames[0] !== "www" &&
+1
-1
apps/web/next.config.js
···
104
104
"^(?!.*\\.openstatus\\.dev$)(?!openstatus\\.dev$)(?<domain>.+)$",
105
105
},
106
106
],
107
107
-
destination: "https://www.stpg.dev/:path*",
107
107
+
destination: "https://www.stpg.dev/:domain/:path*",
108
108
},
109
109
],
110
110
};