Git Product home page Git Product logo

redisred's Introduction

A small Redis-based URL Redirector

Give it a test!

If you want to test it out first hand, try it here: https://redisred.herokuapp.com/admin

Username: admin Password: testing

Features

Randos

  • Visitors can go to /whatever, and they'll be redirected to link named whatever
  • If the link doesn't exist, they'll be presented with a nice 404 page :)
  • Visiting just / brings you to a designated root redirect.

Admins

  • /admin brings people to page where they can sign in
  • /admin/redirects lets people view and edit all of the redirects

API

All requests must be authenticated with a x-access-token header.

  • GET /admin/api/ returns a json of all the redirects
  • POST /admin/api/create creates a redirect with parameters key and url
  • POST /admin/api/delete deletes a redirect with parameter key

How to get up and running

Some quick easy steps:

  1. Make sure you have gcc, brew, node, and npm installed.
  2. Run brew install redis
  3. Run npm install && npm run create-config
  4. Edit the .env file to have the environment variables you like :)

How to run the app locally

  1. npm run start-redis
  2. npm start

To stop the server, Ctrl+C, and then:

  • npm run stop-redis

Deploy the app to heroku

To deploy this to heroku, click this fancy button :)

Environment variables.

Variable Description
PORT The port this app should run on
ADMIN_USERNAME The username used to log into the admin console
ADMIN_PASSWORD The password used to log into the admin console
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

License

Redisred is released under the MIT license.

redisred's People

Contributors

detry322 avatar randallkent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

redisred's Issues

Case insensitive URLs

Do we want to consider making links case-insensitive? so like example.com/link will be the same as example.com/Link and example.com/LINK.

This would involve:

  • canonicalizing (downcasing) things as they're entered in the admin interface
  • canonicalizing things before they're looked up in redis

Make it responsive

<meta name="viewport" content="width=device-width, initial-scale=1">

Also, some kind of responsive table

I want to make links on my phone pls ;'(

Strip link extensions

Make https://redisred.herokuapp.com/hello.png equivalent to https://redisred.herokuapp.com/hello if target hellog.png is not registered already (i.e. strip "file" extension).

This allows forums which filter on valid sources for [img] tags being png/gif/jpg static files to be fooled to redirect to svg or any dynamic content (github badges?).

http://ow.ly does it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.