Skip to content

ret0rn/urlCutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

urlCutter

A simple web API for link shortening

GitHub GitHub go.mod Go version

Set Up

Docker Compose generate short url

dokcer-compose up

Manual generate short url

  1. edit database config in ./configs/database.json
  2. use psql -U postgres -f db.sql for create database
  3. use go run . to start app

Usage

Endpoint Method Params Description
/generate POST long_url: <str> Generates a short url
/:short_url GET None Find long url and redirect

Request

generate short url

Result

redirect to long  url