Giter Site home page Giter Site logo

blink's Introduction

blink

A URL shortener service.

Features

  • Shortens the URLs.
  • Supports redirects for shortened URLs.
  • Shows metrics for top 3 shortened domains.
  • Uses Redis for storing the data regarding URLs.
  • Reports same URL for multiple shortening sessions of same URL instead of generating new one.

Setup

Manual

You need to have Go (>1.13 at least) and Redis installed.

  1. Clone this repository.
  2. Run make build to build the binary named as blink.bin.
  3. In another terminal session, start a local redis server through the redis-server command. It should be running by default on port 6379.
  4. Set environment variables:
    • REDIS_ADDRESS=localhost:6379
    • APP_PORT=8080
  5. Run make run to execute the binary.

Docker

  1. Download the docker-compose.yml file.
  2. To execute Blink, run docker-compose up -d command and then the app should be ready on port "8080".
  3. The docker-compose.yml uses my docker image pushed on Docker Hub.

API Routes

  • POST /api/shorten : Returns the shortened URL for the URL sent in the request body in the below form.
{"long_url":"https://google.com/helloworld"}
  • GET /api/metrics : Returns the top 3 most shortened domains along with the count of being shortened.

blink's People

Contributors

sidntrivedi012 avatar deepsource-io[bot] avatar

Stargazers

Ankesh Bharti avatar

Watchers

James Cloos avatar  avatar  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.