Documentation
¶
Overview ¶
Command qrest is a quick RESTful JSON server
How to use ¶
Create a JSON file containing the data you'd like to be part of your server. An example file might look like:
{
"posts": [ { "id": 1, "title": "Foo" } ]
}
Start qrest with this file as an argument:
qrest db.json
Or in a docker container:
$ docker build -t qrest . $ docker run --rm -p 3000:3000 qrest "db.json" # assuming db.json is in this source directory
This will create the following routes for you to use:
POST /posts (creates a new post record) GET /posts (returns all post records) GET /posts/:id (returns a specific record) PUT /posts/:id (creates or updates a record with the specified ID) PATCH /posts/:id (updates a record with the specified ID) DELETE /posts/:id (deletes the specified record)
Directories
¶
| Path | Synopsis |
|---|---|
|
Godeps
|
|
|
_workspace/src/github.com/codegangsta/negroni
Package negroni is an idiomatic approach to web middleware in Go.
|
Package negroni is an idiomatic approach to web middleware in Go. |
|
_workspace/src/github.com/julienschmidt/httprouter
Package httprouter is a trie based high performance HTTP request router.
|
Package httprouter is a trie based high performance HTTP request router. |
Click to show internal directories.
Click to hide internal directories.