A minimal URL shortener/manager
Blinky is a minimal URL shortener/manager.
You can map long urls to specific subpaths (ex. /docs
-> https://example.com
).
A Docker image is available on Docker Hub as jonahsnider/blinky
.
It requires the following environment variables to be set:
DATABASE_URL
ADMIN_PASSWORD
BASE_URL
Please see below installation instructions for information on what these should be defined as.
Clone the project
git clone https://github.com/jonahsnider/blinky.git
Install dependencies
npm ci
Build the project
npm run build
Set environment variables
The server needs a few environment variables to be defined in order to function:
Variable | Description |
---|---|
DATABASE_URL |
A MySQL connection URL, following this format |
ADMIN_PASSWORD |
A password for accessing the admin interface |
BASE_URL |
A well-formed URL where the service is hosted (ex. https://blinky.example.com ) |
You can either define these directly in your system environment, or use a .env
file in the project root:
# .env
DATABASE_URL=mysql://user:password@host:port/database
ADMIN_PASSWORD=password
BASE_URL=https://blinky.example.com
Documentation for how .env
is parsed is here.
Run database migrations
npm run migrate
Pull the latest changes
git pull
Install dependencies
npm ci
Build the project
npm run build
Run database migrations
npm run migrate
Start the server:
npm start
The PORT
environment variable can be defined (not in .env
) to set what port the server will listen on:
PORT=8080 npm start