Spring REST API demo application built for UHN
#Introduction
- The application uses an H2 database to host the patient repository.
- Application runs on 8080 port.
- Browser operations are done on the context-path /demo
- Postman or CURL operations can be performed on path /api
- Logging is done on the console instead of a file.
Steps to build and run the application.
- Clone the repository onto a folder on the machine.
- Step inside UHNSpringDemo folder.
- Invoke git bash.
- Run mvn clean install. This will build the code base and create target folder.
- After the process finishes, navigate to the target folder.
- Run java -jar demo-0.0.1-SNAPSHOT.jar
Supported APIs and operations.
1 GET localhost:8080/api/start : Welcome to the UHN Spring Demo!
2 GET localhost:8080/api/getAllPatients Returns a list of all the patients that exists within the repository.
3 GET localhost:8080/api/getPatient/{id} Performs a search of patient by Id.
4 GET localhost:8080/api/searchPatients/{keyword}
Performs a search by keyword matching on the firstName or lastName
5 POST localhost:8080/api/addNewPatient
Adds new Patient within the repository and returns the data of the patient just created with its id.
6 POST localhost:8080/api/bulkAddPatients
Adds a List of patients within the repository and returns the data of patients just created with their respective Ids.
7 DELETE localhost:8080/api/clear
Deletes all Patients within the repository.