Provides an example CRUD REST service using JavaLite technologies.
You need to do this only once. Foe more information see Database migrations.
mvn db-migrator:create
Running is the same as any other Java app:
mvn jetty:run
and then navigating to http://localhost:8080/people.
is easy by executing this command (from root of this project):
curl -X POST -H "Content-Type: octet/stream" --data-binary @src/test/resources/people.json http://localhost:8080/people
Navigate to http://localhost:8080/people again and see new people created (and note their IDs).
Explore an individual person: http://localhost:8080/people/1, where "1" is an ID of a single person
- Models are simple: src/main/java/app/models. Only the Person model
has a method
getAddresses()
, otherwise no methods - RESTful controller uses automatic routes: PeopleController.java
- Exceptional conditions handled outside business logic: CatchAllFilter.java
- JSON is generated using powerful templating: with partials and children - people views
- Tests expect certain JSON structure and data: PeopleControllerSpec.java