hemanth / koa-rest

REST demo with koa.

Home Page:http://is.gd/frReGf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#koa-REST

REST demo with koa.

This is a simple demo of RESTful API with koajs checkout the live demo

How to try it?

$ git clone https://github.com/hemanth/koa-rest.git

$ cd koa-rest

$ mongoimport -d library -c books ./db.json  # Import the DB, makes sure mongod is running.

$ npm install

$ npm run start

Open http://localhost:1337 to see the results.


GET /books -> List all the books in JSON.

GET /books/:id -> Returns the book for the given ID

POST /books/ -> JSON data to inserted to the books db.

PUT /books/:id -> JSON data to update the book data.

DELETE /books/:id -> Removes the book with the specified ID.

OPTIONS / -> Gives the list of allowed request types.

HEAD / -> HTTP headers only, no body.

TRACE / -> Blocked for security reasons.

About

REST demo with koa.

http://is.gd/frReGf


Languages

Language:JavaScript 80.9%Language:HTML 15.6%Language:CSS 3.5%