Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vdustr/my-vercel-redirect
My redirect repository for vercel subdomains
https://github.com/vdustr/my-vercel-redirect
domain nodejs redirect subdomain typescript vercel
Last synced: about 1 month ago
JSON representation
My redirect repository for vercel subdomains
- Host: GitHub
- URL: https://github.com/vdustr/my-vercel-redirect
- Owner: VdustR
- License: mit
- Created: 2023-06-18T09:12:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-29T06:28:33.000Z (about 1 year ago)
- Last Synced: 2023-08-29T11:33:30.530Z (about 1 year ago)
- Topics: domain, nodejs, redirect, subdomain, typescript, vercel
- Language: TypeScript
- Homepage: https://vercel.com/docs/concepts/edge-network/redirects
- Size: 162 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# My Vercel App for Subdomain Redirects
This is a Vercel application that enables subdomain redirection to other domains using Edge Middleware.
## Usage
- Fork this repository and modify the `myDomain` and `subdomainMap` variables in `middleware.ts`.
- Deploy the forked repository to Vercel and set up the domain listed in the `subdomainMap` variable.## Local Testing
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 replace `my.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.
## Reference
- [Redirects](https://vercel.com/docs/concepts/edge-network/redirects)
- [Edge Middleware](https://vercel.com/docs/concepts/functions/edge-middleware)## License
The code is licensed under the [MIT License](./LICENSE), and the documentation is licensed under the [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) license.