http://todomvc.com but using server-side technologies.
A contact is completely described as:
{
"id": <integer>,
"name": "<string>",
"phone": "<string>"
}
If you choose to use an SQL-based persistence, here is some example DDL:
CREATE TABLE contacts (
id INTEGER NOT NULL PRIMARY UNIQUE AUTOINCREMENT,
name TEXT NOT NULL,
phone TEXT NOT NULL
);
The above is SQLite compatible syntax.
If you choose to use file-based persistence, please use OS-independent path handling/access where possible.
URI | Responses1 | HTTP Method (Verb) and Parameters | Description |
---|---|---|---|
/contacts | 200, 204 | GET | list all contacts |
/contact | 201, 400 | POST with JSON representation of new contact | create a new contact |
/contact/\ |
200, 404 | GET | display a specific contact |
/contact/\ |
200, 400, 404 | PUT with JSON representation of new data | update a specific contact |
/contact/\ |
204, 404 | DELETE | delete a specific contact |