This project serves as a demonstration of building a RESTful API using Java Spring Boot. REST, or Representational State Transfer, is an architectural style for designing APIs (Application Programming Interfaces) that enable different software systems to communicate and interact with each other over the internet. It emphasizes using standard HTTP methods (like GET, POST, PUT, DELETE) to perform actions on resources (such as data) in a clear and consistent manner. RESTful APIs allow clients (applications or devices) to request and manipulate data by following a set of conventions, making it a widely used approach for building web services and APIs.
Java 17 (openjdk), Maven, Spring Boot
The sh folder allows you to quickly launch docker commands to perform tasks
On the root folder
sh sh/buildsh sh/deployThe service is deployed at http://localhost:8085
Swagger UI, the interactive documentation tool for your API, is accessible at the URL http://localhost:8085/swagger-ui/index.html, providing a user-friendly interface to explore and test your APIs. Additionally, the raw Swagger JSON representation of your API documentation can be accessed at http://localhost:8085/v3/api-docs, serving as a machine-readable document describing your API endpoints and schemas.
Get all personnes :
curl -X 'GET' \
'http://localhost:8085/api/personnes' \
-H 'accept: */*'Create personne :
curl -X 'POST' \
'http://localhost:8085/api/personnes' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"firstName": "toto",
"lastName": "tata"
}'Get a personne :
curl -X 'GET' \
'http://localhost:8085/api/personnes/1' \
-H 'accept: */*'Update personne :
curl -X 'PUT' \
'http://localhost:8085/api/personnes/1' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"firstName": "new-first-name",
"lastName": "new-last-name"
}'Delete personne
curl -X 'DELETE' \
'http://localhost:8085/api/personnes/1' \
-H 'accept: */*'