-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
Andrew Ensley edited this page Sep 14, 2023
·
3 revisions
- A domain for your short URLs, e.g.
example.com - A Cloudflare account
Follow these steps to setup your own, super-fast URL shortener in minutes.
Fork this repository to your GitHub account.
- Log into the Cloudflare Dashboard
- Click Workers & Pages
- Click Create Application
- Click the Pages tab
- Click Connect to Git
- Select your repository and click Begin Setup
- Leave the defaults for everything, except:
-
Build command:
npm run build -
Build output directory:
dist
-
Build command:
- Click Environment variables (advanced) and add the variables you want (
DOMAINat a minimum) - Click Save and Deploy
TBA
TBA
TBA
Configuration is performed through Cloudflare Pages' Environment variables.
| Environment Variable | Required | Default | Description |
|---|---|---|---|
DOMAIN |
YES | The domain for your URL shortener. This will be used as the base for your short URLs. | |
SHORT_CODE_LENGTH |
No | 4 | The length to use for automatically generated short-codes. |
LINK_TO_DASH |
No | false | Set to true to show a link to your dashboard on the public home page. |