Git Product home page Git Product logo

simpleshortener's Introduction

SimpleShortener

And now, introducing something I made during lunch.

SimpleShortener is a simple redis backed nginx url shortener.

It was inspired by https://github.com/MendelGusmao/nginx-redis-url-shortener and http://uberblo.gs/2011/06/high-performance-url-shortening-with-redis-backed-nginx.

It is intended to be used as a standalone service. The idea being that you'll be hosting it on a short domain like http://go.to, and redirecting to a longer domain like http://example.com.

This isn't to say you can't use under a single domain, it just wasn't created with that in mind.

If you find this software useful. I'd love to hear from you, drop me a line at [email protected] and let me know your thoughts.

So, what's good about it?

It's simple. It should be fast. It should scale well. (I haven't benchmarked it)

Requirements

Or instead of openresty:

Getting Started

Installation

  1. Extract the zip somewhere.
  2. Modify the first line of nginx.conf to use the account you want. For example: user www staff;

Starting the server

nginx -p /path/to/simpleshortener

Shortening a URL

Pass your URL as the parameter "url" to /shorten, for example:

http://localhost/shorten?url=http://somelongdomain.com/somelongpath/somelongfilename.somelongextension

And out pops the short url:

http://localhost/28lK

Note that you can change the number of characters in the URL changing the number of 9 in line 60 of pack.lua.

Expanding a URL

Open the short url in your browser. Ta da!

simpleshortener's People

Contributors

alexchittock avatar

Watchers

 avatar James Cloos avatar

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.