Skip to content

A local URL Shortener but better 🌐πŸ–₯️

Notifications You must be signed in to change notification settings

Yoru-cyber/URL-Shortener-V2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

URL Shortener βœ‚οΈ

Description πŸ™

This is a minimalistic web service that shortens an URL. This service saves the original and shortened URLs in a Redis database for quick retrieval. The project leverages a minimal API style using .NET to ensure a clean and efficient codebase.

Tech Stack πŸ“

logos of dotnet, docker and redis

Instructions to Run πŸ§‘β€πŸ’»

Prerequisites

  • Docker installed on your machine.

Steps to Run

  1. Clone the Repository

    git clone <repository-url>
    cd url-shortener
  2. Build and Run the Docker Containers

    Use Docker Compose to build and start both the URL Shortener API and Redis containers.

    docker-compose up --build
  3. Access the API

    Once the containers are up and running, the URL Shortener API will be accessible at:

    http://localhost:3001
    

API Endpoints

  • Shorten URL

    POST /shorten
    

    Request Body:

    {
      "url": "https://example.com"
    }

    Response:

    {
      "message": "success",
      "shortUrl": "http://localhost:5000/abc123"
    }
  • Redirect to Original URL

    GET /{shortUrl}
    

    Accessing the shortened URL will redirect to the original URL.

Stopping the Containers

To stop the running containers, use:

docker-compose down

About

A local URL Shortener but better 🌐πŸ–₯️

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published