Giter VIP home page Giter VIP logo

go-short's Introduction

URL Shortener

The URL Shortener is a Go and Redis-based application that allows users to generate short and shareable links for long URLs.

Features

  • Generate short URLs from long URLs
  • Redirect users to the original destination when accessing the short URL
  • Efficient storage and retrieval of URLs using Redis
  • Scalable and high-performance solution built with Go

Installation

To run the URL Shortener locally, you need to have Docker and Docker Compose installed on your system. You can find installation instructions for your operating system on the Docker website.

Clone the Repository

git clone https://github.com/your-username/go-short.git
cd go-short

Set up Redis

The URL Shortener uses Redis to store and retrieve URLs.

Usage

The URL Shortener can be easily built and run using Docker Compose. Follow these steps:

  1. Build and run the Docker containers:

    docker-compose up -d
    

    This command will build and start the URL Shortener and Redis containers in the background.

  2. Access the application:

    Test the application by sending a POST request to the `http://localhost/api/v1` endpoint with a long URL in the request body:
    

Configuration

The URL Shortener can be configured via environment variables in the docker-compose.yml file. The following variables are available:

  • DB_ADDR= (default: db:6379): Redis server address
  • DB_PASS (default: empty): Redis server password (if required)
  • APP_PORT (Port on which the application will run)
  • DOMAIN (http://localhost:APP_PORT) Make sure to set these variables according to your Redis configuration in the docker-compose.yml file before running the application.

go-short's People

Contributors

lalitdotdev avatar

Watchers

 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.