A small Redis-based URL Redirector
If you want to test it out first hand, try it here: https://redisred.herokuapp.com/admin
Username: admin
Password: testing
- Visitors can go to
/whatever, and they'll be redirected to link namedwhatever - If the link doesn't exist, they'll be presented with a nice 404 page :)
- Visiting just
/brings you to a designated root redirect.
/adminbrings people to page where they can sign in with Google OAuth/admin/redirectslets people view and edit all of the redirects
All requests must be authenticated with a x-access-token header.
GET /admin/api/returns a json of all the redirectsPOST /admin/api/createcreates a redirect with parameterskeyandurlPOST /admin/api/deletedeletes a redirect with parameterkey
Some quick easy steps:
- Make sure you have
gcc,brew,node, andnpminstalled. - Run
brew install redis - Run
npm install && npm run create-config - Edit the
.envfile to have the environment variables you like :)
npm run start-redisnpm start
To stop the server, Ctrl+C, and then:
npm run stop-redis
To deploy this to heroku, click this fancy button :)
| Variable | Description |
|---|---|
| PORT | The port this app should run on |
| OAUTH2_PROXY_CLIENT_ID | The client ID of your Google app |
| OAUTH2_PROXY_CLIENT_SECRET | The client secret of your Google app |
| API_TOKEN | The token to be used on all API calls |
| ROOT_REDIRECT | The URL the root of your website should redirect to |
| SESSION_SECRET | A secret key for verifying the integrity of signed cookies |
| ALLOWED_USERS | The Google Plus IDs of users you want to allow to log in |
Redisred is released under the MIT license.

