SantosReis / laravel10-shortener

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

URL Shortener

Backend URL Shortener to integrate with frontend following frontend: vue-url-shortener.

NOTE: SQLite is enabled to use.

Features

  • REST API Design
  • Generate url shortener
  • Redirect shortener to original ones
  • Database storage

Testing features available

NOTE: there are 2 of 5 tests deployed

php artisan test --filter=UrlShortenerTest

API endpoints available

POST /api/shortener Generate URL Shortener
Parameters
name type data type description
url required string (255) The url to be shortened
Responses
http code content-type response
200 application/json JSON string
Example cURL
 curl -X GET -H "Content-Type: application/json" http://localhost:8889/api/shortener
GET /api/shortener-list Listing URL Shorteners
Parameters

None

Responses
http code content-type response
200 text/plain;charset=UTF-8 JSON string
Example cURL
 curl -X GET -H "Content-Type: application/json" http://localhost:8889/api/shortener-list

About


Languages

Language:PHP 100.0%