Skip to content
allashPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

URL shortener app in Golang

Getting Started

Prerequisites

  • Go 1.23+
  • PostgreSQL
  • Docker

Installation

  • Clone the repository

    git clone git@github.com:allash/shortly.git
    cd shortly
  • Install dependencies

    go mod download
  • Configure .env file

    DB_CONNECTION_STRING={YOUR_DB_CONNECTION_STRING}
  • Run postgres

    cd infra
    docker-compose up -d
  • Run application

    go run ./cmd/api
    
    # if you already have installed Air then you can just run
    air

API endpoints

  • GET /health
  • GET /v1/{shortUrl}
  • POST /v1/url/shorten

Request body

  {
    "value": "http://localhost:4000"
  }

Flowchart

Flowchart

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages