Embedded-tomcat-rest-example
A simple example of a REST API with Jersey on an embedded Tomcat
Run rest.Application
to start a server on http://localhost:8080/api/v1
There is only one resource provided at /examples
for demonstration purposes
Currently available endpoints
http://localhost:8080/api/v1/examples
GET @ Returns a JSON array of Examples
http://localhost:8080/api/v1/examples/{id}
GET @ Returns a single JSON Example by its id
http://localhost:8080/api/v1/examples/{id}
PUT @ Updates a single JSON Example by its id. Requires an Example JSON in request body as follows:
{"id":"4","title":"Example 4"}
http://localhost:8080/api/v1/examples/{id}
DELETE @ Deletes an Example by id
http://localhost:8080/api/v1/examples/post
POST @ Creates a new JSON Example. Requires an Example JSON in request body as follows:
{"id":"4","title":"Example 4"}