This is a Vercel application that enables subdomain redirection to other domains using Edge Middleware.
- Fork this repository and modify the
myDomain
andsubdomainMap
variables inmiddleware.ts
. - Deploy the forked repository to Vercel and set up the domain listed in the
subdomainMap
variable.
Requirements: please check the engines
field in package.json
.
- Run
pnpm install
to install dependencies. - Run
pnpm vercel:dev
to start the local development server. - Add
127.0.0.1 my.domain
to your/etc/hosts
file and replacemy.domain
with your desired domain. - Open your browser and visit
http://my.domain:3000
.
Please note that Chrome automatically redirects .dev
domains to https
, so you may need to use a different apex domain for local testing.
The code is licensed under the MIT License, and the documentation is licensed under the CC BY-NC-SA 4.0 license.