https://github.com/ankhoa1212/rest-api-web-service
This project was done in Jan. 2024
https://github.com/ankhoa1212/rest-api-web-service
java json rest-api spring-boot unit-testing
Last synced: about 2 months ago
JSON representation
This project was done in Jan. 2024
- Host: GitHub
- URL: https://github.com/ankhoa1212/rest-api-web-service
- Owner: ankhoa1212
- Created: 2024-12-11T23:28:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-11T23:44:50.000Z (over 1 year ago)
- Last Synced: 2025-02-06T20:23:59.911Z (over 1 year ago)
- Topics: java, json, rest-api, spring-boot, unit-testing
- Language: Java
- Homepage:
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
When the main function in `RestServiceApplication.java` found [here](https://github.com/ankhoa1212/rest-api-web-service/blob/main/rest-service/src/main/java/com/example/restservice/RestServiceApplication.java) is run, the application runs on http://localhost:8080
The app can receive GET and POST requests on http://localhost:8080/employees/
A GET request returns the employees
Employees can be added via a POST request, which can receive and return JSON in the following format:
```
{
"id" : "4",
"firstName" : "Mary",
"lastName" : "Poppins",
"email" : "mpoppins@gmail.com",
"title" : "Ms."
}
```
The app can also receive GET requests on http://localhost:8080/greeting
or http://localhost:8080/greeting?name=yourname
and returns a unique message id and a greeting message:
```
{
"id": 1,
"content": "Hello, World"
}
```
Unit tests can be found [here](https://github.com/ankhoa1212/rest-api-web-service/tree/main/rest-service/src/test/java/com/example/restservice)