This is a simple RESTful CRUD (Create Read Update Delete) application for managing Boards, Notices and Authors saved in PostgreSQL database. It provides basic REST endpoints like fetching all objects of given type, finding them by their id, creating them and so on.
An application expose 5 REST endpoints for each entity. For example Notice (and any other) they are:
- GET
{baseURL}/notices/
- lists all Notices (as Json array), - GET
{baseURL}/notices/{id}
- gets single Notice (as Json) by its{id}
, - POST
{baseURL}/notices/
- creates a new Notice which is passed in the BODY of the request, - PUT
{baseURL}/notices/{id}
- updates an existing Notice (with an{id}
) withNotice
passed in the body of the request, - DELETE
{baseURL}/notices/{id}
- deletes an existing Notice by its{id}
.
If you run this application locally the {baseUrl}
would be http://localhost:8080
.
All available endpoints are listed on Swagger UI page which can be entered, when application is running, under http://localhost:8080/swagger-ui.html URL.
Before running the application make sure that you are running PostgreSQL database on your local machine.
In order to run it use following command:
mvn clean spring-boot:run
In this project there are located several integration tests for REST endpoints during which H2 database is used. To run those tests activate Mavan -P integration-test
profile:
mvn clean verify -P integration-test
The MIT License - 2020 - Wojciech Krzywiec