This project special for Mister Aladin. Required: Docker-compose
Step to install this project :
docker-compose up
to run the applicationdocker-compose exec app composer install
will generate depedencies in vendor foldercp .env.example .env
to copy environtment configurationdocker-compose exec app php artisan migrate
- Project will run on http://localhost:8088, and check database on http://localhost:8081 (user: root password: secret)
Project created with Laravel Framework, included:
- Get Short URL and Redirect to Long URL
- Create Long URL and Generate Short URL (format: MA-randomURL)
- Update Direct URL
- Delete Direct URL
Direct Short URL to Long URL
- URL: http://localhost:8088/:shorturl
- Method:
GET
Example URL: http://localhost:8088/MA-LS5NA You will redirect to: http://misteraladin.com/hotel/search?q=jakarta&m=12&d=1
Generate Short URL
- URL: http://localhost:8088/api/direct/create
- Method:
POST
- URL Params required longurl=[string]
Example Response:
{
"message": "data successfully created",
"data": {
"shorturl": "MA-LS5NA",
"longurl": "http://misteraladin.com/hotel/search?q=jakarta&m=12&d=1",
"updated_at": "2019-08-19 17:07:12",
"created_at": "2019-08-19 17:07:12",
"id": 10
}
}
Update Long URL
- URL: http://localhost:8088/api/direct/update
- Method:
POST
- URL Params required id=[integer] longurl=[string]
Example Response:
{
"message": "data successfully updated"
}
Delete URL by ID
- URL: http://localhost:8088/api/direct/delete/:id
- Method:
DELETE
Example Response:
{
"message": "data successfully deleted"
}
The Laravel framework is open-source software licensed under the MIT license. Project special for Mister Aladin. Project developed by Sandi Permana