create the template src/main/resources/templates/barista/RestController.java
add methods for a BREAD on a given resource foo, following REST uniform interface (note: the controller here should be annotated with @RestController and not @Controller):
browse:GET: /foosdescription: get a JSON of all foo resources
read:GET: /foos/{id}description: get a JSON of the foo resource identified by id
update:PUT: /foos/{id}description: store the modified foo resource and return a redirection to its read endpoint
store:POST: /foosdescription: store the new foo resource and return a redirection to its read endpoint
destroy:DELETE: /foos/{id}description: delete the foo resource identified by id
create the template src/main/resources/templates/barista/RestController.java
add methods for a BREAD on a given resource
foo
, following REST uniform interface (note: the controller here should be annotated with@RestController
and not@Controller
):browse:
GET: /foos
description: get a JSON of all foo resourcesread:
GET: /foos/{id}
description: get a JSON of the foo resource identified byid
update:
PUT: /foos/{id}
description: store the modified foo resource and return a redirection to its read endpointstore:
POST: /foos
description: store the new foo resource and return a redirection to its read endpointdestroy:
DELETE: /foos/{id}
description: delete the foo resource identified byid