Includes web-server on port 9080 with /api/v1/articles
endpoint exposed.
Supports CRUD set of operations and Read with pagination (see usage description below).
- Maven 3
- JDK 21
mvn clean install
docker build ./ -t backend-template-app
Use run.bat script
java -jar target/spring-boot-3-template-0.0.1-SNAPSHOT.jar \
--spring.datasource.url=jdbc:h2:mem:testdb \
--spring.datasource.username=sa \
--spring.datasource.password=password \
--spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect \
--spring.datasource.driver-class-name=org.h2.Driver
java -jar target/spring-boot-3-template-0.0.1-SNAPSHOT.jar \
--spring.profiles.active=dev
mvn spring-boot:run -Dspring-boot.run.arguments="\
--spring.datasource.url=jdbc:h2:mem:testdb \
--spring.datasource.username=sa \
--spring.datasource.password=password \
--spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect \
--spring.datasource.driver-class-name=org.h2.Driver"
mvn spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=dev
docker-compose up
docker-compose up --build --force-recreate --no-deps
http://localhost:9080/api/v1/articles
http://localhost:9080/swagger-ui.html
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -d '{ "title": "Some tittle", "text": "Some text", "author": "Pushkin" }' -X POST http://localhost:9080/api/v1/articles
curl -i http://localhost:9080/api/v1/articles/1
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -d '{ "title": "Another tittle" }' -X PATCH http://localhost:9080/api/v1/articles/2
curl -i 'http://localhost:9080/api/v1/articles?size=2&page=4&sort=author,DESC'
curl -i -X DELETE http://localhost:9080/api/v1/articles/1