Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

readme

  • Loading branch information...
commit 346cd14d0fae71d9f083fee63a6013b65c8d9ce1 1 parent 39f05d6
Rasmus authored

Showing 1 changed file with 16 additions and 27 deletions. Show diff stats Hide diff stats

  1. +16 27 examples/example1/README.md
43 examples/example1/README.md
Source Rendered
@@ -14,33 +14,22 @@ A good way to explore and play with Oui server APIs is to use [cURL](http://curl
14 14
15 15 All server code in this example lives in `server.js`.
16 16
17   -
18   -### GET /messages -> {id:message, ..}
19   -
20   -Retrieve all messages. Returns a map `id => message`.
21   -
22   -### POST message -> /messages -> {id:int}
23   -
24   -Add a new message. Returns the new message id.
25   -
26   -### GET /messages/:id -> {id:int, message:object}
27   -
28   -Retrieve a specific message with id `:id`. Returns a message.
29   -
30   -### PUT|POST message -> /messages/:id -> {message:object}
31   -
32   -Assign a message to the id `:id`. Returns any message previously assigned to `:id`.
33   -
34   -### DELETE /messages/:id -> {message:object}
35   -
36   -Remove a message with id `:id`. Returns the message which was deleted.
37   -
38   -### POST /messages/:id/delete -> {message:object}
39   -
40   -Like `DELETE /messages/:id -> message` but implemented as POST to support old browsers (which are unable to send DELETE requests).
41   -
42   -
43   -## Sample cURL session
  17 +- `GET /messages -> {id:message, ..}`
  18 + -- Retrieve all messages. Returns a map `id => message`.
  19 +- `POST message -> /messages -> {id:int}`
  20 + -- Add a new message. Returns the new message id.
  21 +- `GET /messages/:id -> {id:int, message:object}`
  22 + -- Retrieve a specific message with id `:id`. Returns a message.
  23 +- `PUT|POST message -> /messages/:id -> {message:object}`
  24 + -- Assign a message to the id `:id`. Returns any message previously
  25 + assigned to `:id`.
  26 +- `DELETE /messages/:id -> {message:object}`
  27 + -- Remove a message with id `:id`. Returns the message which was deleted.
  28 +- `POST /messages/:id/delete -> {message:object}`
  29 + -- Like `DELETE /messages/:id -> message` but implemented as POST to support
  30 + old browsers (which are unable to send DELETE requests).
  31 +
  32 +### Sample cURL session
44 33
45 34 $ curl localhost:8080/messages
46 35 {}

0 comments on commit 346cd14

Please sign in to comment.
Something went wrong with that request. Please try again.