Giter Club home page Giter Club logo

shrtr's Introduction

Shrtr

Shrtr is a small rack appliance to handle redirects between short URL paths on one domain, to full URLs on any other.

It reads in a Yaml configuration file containing static mappings, and will 301 redirect to the destination when provided.

Any other URL is redirected to a specified fall-back.

The YML mappings for my own use are generated by a Jekyll static site, but could either represent a manual list, or be replaced with a base-60 conversion where IDs make for appropriate slugs.

Configurationb

Configure config/shrtr.yml to point to your source of short URL mappings, and the URL to redirect to in the event of a missing mapping (e.g. 404 handler on your site.)

The mappings file is a simple YAML configuration file:

shorturls:
  -
    id: 1dkfL_
    url: https://example.com/full/article/23235.html
  -
    id: 1qnuL0
    url: https://example.com/full/article/523232.html
  -
    id: 1oY6A0
    url: https://example.com/full/article/51212.html

Running

Run the appliance via thin:

thin -R ./config.ru start

shrtr watches the mappings file for changes, and reload it when updated.

shrtr's People

Contributors

benward avatar

Watchers

 avatar James Cloos avatar

shrtr's Issues

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.