A small Redis-based URL Redirect. The original base for bjc.link was built from redisred.
/
brings you to a designated root redirect./admin
brings people to page where they can sign in with Google./admin/redirects
lets people view and edit all of the redirects./admin/users
to manage who has access to create redirects.All requests must be authenticated with a x-access-token
header.
GET /admin/api/
returns a json of all the redirectsPOST /admin/api/create
creates a redirect with parameters key
and url
POST /admin/api/delete
deletes a redirect with parameter key
Some quick easy steps:
gcc
, brew
, node
, and npm
installed.brew install redis
npm install && npm run create-config
.env
file to have the environment variables you like :)npm run start
(To stop the server, Ctrl+C
)
Variable | Description |
---|---|
PORT | The port this app should run on |
ADMIN_EMAIL | The email of the first admin |
API_TOKEN | The token to be used on all API calls |
DOMAIN | The url the site will be hosted from |
GOOGLE_ANALYTICS_ID | Track visits with Google Analytics |
GOOGLE_CLIENT_ID | Google OAuth Client id (from app console) |
GOOGLE_CLIENT_SECRET | Google OAuth Client secret (from app console) |
ROOT_REDIRECT | The URL the root of your website should redirect to |
SESSION_SECRET | A secret key for verifying the integrity of signed cookies |
bjc.link is released under the MIT license.