Demo application using Spring Boot framework. Since it's one of the widely recognized open source framework in the industry. Particularly Sprint Boot provides OPS ready capability libraries. So I have given my favor to this. Application uses following libraries-
compile('org.springframework.boot:spring-boot-starter-data-mongodb', 'org.springframework.boot:spring-boot-starter-security', 'org.springframework.boot:spring-boot-starter-actuator', 'org.springframework.boot:spring-boot-starter-web')
Appliation implementated with following endpoints. Supports only JSON message format.
Token
HTTP Verb | Endpoint URI |
---|---|
POST | http://localhost:8080/token |
Account
Supports filter option on profession, city, zipCode attributes and Pagination (page, count, sort, order). Should be passed as query param. Group by option is not implemented.
File System
HTTP Verb | Endpoint URI |
---|---|
GET | http://localhost:8080/fs |
GET | http://localhost:8080/fs?rp=build |
App Health
Implemented via built-in capabilities of spring boot actuator libraries. Management endpoint can be access via localhost:9001
HTTP Verb | Endpoint URI |
---|---|
GET | http://localhost:9001/health |
In the industry various implementation concept floating around. From my point view nothing is wrong, I would its trade-off by organization/team.
- Content Negotiation via Header {Accept, Content-Type}
- Version info in endpoint path
For REST API versioning, there are many debates around the internet, I personally perfer Content Negotiation
approach.
Demo application has a Integration test case. Test report is at -
<PROJECT_DIR>/build/reports/tests/classes/com.demo.exercise.it.DemoApplicationIntegrationTest.html