This is an archived repository. For an actively maintained copy of this repository, please visit @hackclub/hack.af. It uses a similar codebase, but it has been rewritten by @zanedb to run serverlessly on Vercel.
- Please make a copy of the template AirTable Base: https://go.mingjie.info/template
- Please also grab the AirTable API Key & Base Key from the API documentations. Head here and click on the base you just created to get started.
- Set
AIRTABLE_BASE
to your Base Key, andAIRTABLE_KEY
to your API Key. - Set
APP_USER
to your desired username. - Set
APP_SECRET
to a passphrase or key that only you know. - Set
LOGGING
toon
if you want to enable logging,off
if otherwise. - Set
ROOT_REDIRECT
to the URL you want people to be redirected to when they visit the landing page.
All links will be routed through a 302 (Temporary Redirect) because you're using AirTable. Simply visit example.com/slug
to get redirected.
Navigate to /admin
for a GUI to add new links.
You can make changes the database easily with the API.
Find where a slug points to without getting redirected.
slug
(required) - the slug you're looking up.
dest
- the destination URL.error
- the error message, if exists.status
- status code of the request
Make changes to a specific record.
auth
(required) - theAPP_SECRET
environment variable, used for authentication.dest
(optional) - the destination URL you're pointing to. Must exist ifslug
does not exist.slug
(optional) - the slug you're making changes to. If it does not exist, a random slug will be generated. Must exist ifdest
does not exist.
error
- the error message, if exists.slug
- the slug of the short link, if generatedstatus
- status code of the request
ABLS is released under the MIT license.