Prerequisites:
Back-end: Spring Boot, Maven
Database: GridDB 5.1.0
Build the docker image:
docker compose build
Run the app with Docker Compose:
docker compose up
- The application runs on port 8080.
- Port 35729 allows the livereload plugin to listen to changes
- Port 5005 makes the debugger available to the IDE
Swagger-UI available at http://localhost:8080/swagger-ui/index.html
POST http://localhost:8080/api/urls
curl --request POST --url http://localhost:8080/api/urls --header 'content-type: application/json' \
--data '{"url": "https://www.javacodegeeks.com/2023/05/what-are-events-relation-to-api-calls.html"}'
{
"url": "https://www.javacodegeeks.com/2023/05/what-are-events-relation-to-api-calls.html",
"shortUrl": "HjlQjET"
}
GET http://localhost:8080/api/urls/{SHORT_URL}
curl --request GET --url http://localhost:8080/api/urls/HjlQjET
{
"url": "https://www.javacodegeeks.com/2023/05/what-are-events-relation-to-api-calls.html",
"shortUrl": "HjlQjET"
}
- Being able to automatically build and deploy changes to without having to manually build or restart the application
- livereload using spring-boot-devtools
tags: url-shortener
shortener
griddb
spring-boot
json-api
docker
live-reload
inotify-tools