Skip to content

Latest commit

 

History

History
29 lines (26 loc) · 932 Bytes

README.md

File metadata and controls

29 lines (26 loc) · 932 Bytes

URL Shortener

This is an extremely simple url shortener API powered by Laravel 5. The short links were generated using the php implementation of the awesome hashids library.

Setup

You can setup this api project by cloning the repo and in the root folder run:

$ touch ./database/database.sqlite
$ docker-compose up -d

Or you can simply run it as a standalone container

$ docker run -tid -p 8000:8000 --name shortener jrszapata/url-shortener-laravel-5.8

Use

Start using the API with you favorite API Client and just send a POST request to /api/links with a property link like:

{
    "link": "http://example.com/this/is/some/example/url.html"
}

that should return something like:

{
  "short_url": "http://localhost:8000/mO"
}

Simple. Now you should be able to start getting a list of top 100 accessed links by calling /api/top-100-links.