- Run a
./gradlew clean build
- Run the service either via
./gradlew bR
, or however you start your Java applications. It will start on port 8080 by default. - Test via postman, or your preferred method of testing APIs. The url is
http://localhost:8080/document
. - Once running you can check available data by connecting to the h2 console. No password is needed, just hit connect.
- NOTE: Besides Springboot, this project uses Lombok to make writing getters and setters unnecessary, as well as adds slf4j for access to easy logging.
- Use a POST call to
http://localhost:8080/document
- Use a JSON body. Sample:
{
"id":1,
"title":"Document Title",
"content": "Any content you like."
}
- Use a GET call to
http://localhost:8080/document/{documentId}
- No body is accepted. You can use an id from a created document, or use one of my precreated ones - 10, 20, 30. E.g. you can try localhost:8080/document/30 right at startup.
- Documents are json based with a title and content.
- No database persistence is required.
- Requirement of "allow(ing) many callers to read and write documents at the same time without issue." does not imply a need for hosting this. If hosted, there is no reason calls can't be made async.