Git Product home page Git Product logo

agogo's Introduction

A-Go-Go: A URL Shortener

A-Go-Go is a simple URL shortener written in Go. A-Go-Go initializes its database of shortened URLs from a file stored at a particular URL. It also hosts an endpoint which allows the user to reload the database by sending a request to it.

Usage

A-Go-Go takes its configuration from commandline flags. The following example retrieves its database from a database hosted on example.net named links.db and listens for requests on the default port:

agogo -links=http://example.net/links.db

The -links flag is the only required flag. By default A-Go-Go listen to port 80 on all interfaces or 0.0.0.0:http. This can be changed with -listen.

The reload endpoint is located at /_reload/. It will respond 200 to any sort of HTTP request. Access to the endpoint can be retricted by providing the -allow flag with a host or IP address. It my be specified more than once. The reload endpoint may be disabled entirely with the -no-reload flag.

Links Format

The links database is a text file containing a shortened link on each line of the file. Each line consists of two parts: the local path hosting the redirection and the URL to redirect to. They are separated by whitespace. Everything after the first instance of whitespace is used as the Location header in the redirection. Blank lines are and lines beginning with # are ignored.

License

Copyright (c) 2014 Ryan Bourgeois. Licensed under BSD-Modified. See the [LICENSE][1] file for a copy of the license.

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.