Skip to content

pratomrerk/url-shorteners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

Easy to use URL shortener

Getting started

View docker-compose.example for an example to docker-compose.yml and edit the environment variables.

Install

docker-compose up -d

Usage

New URL shorteners

curl --location --request GET 'http://127.0.0.1:7788/new-url?url=https://google.com&expire=315360000'
# expire is optional
Response
```json
{
    "check": "http://127.0.0.1:7788/check?url-key=TkUXJ7IZ",
    "count": 0,
    "expire": 1677575761,
    "short_url": "http://127.0.0.1:7788/TkUXJ7IZ",
    "url": "https://google.com"
}

Check Information url-key

curl --location --request GET 'http://127.0.0.1:7788/check?url-key=TkUXJ7IZ'

Response

{
    "count": 2,
    "expire": 1677575761,
    "short_url": "http://127.0.0.1:7788/TkUXJ7IZ",
    "url": "https://google.com"
}

Use short url

http://127.0.0.1:7788/TkUXJ7IZ

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published