GithubHelp home page GithubHelp logo

hapi2's Introduction

One Resource REST API built with Hapi and MongoDB

A project for CodeFellows 401 testing out an alternative to Express

Installation

  1. Install Node.js.
  2. Install MongoDB.
  3. Install Postman.
  4. Run git clone https://github.com/YvonneHayes/hapi2.git.
  5. Install any dependencies/dev-dependencies according to your needs
  6. Use Postman to make requests.

API

Index page is at http://localhost:8080

Books

Make all GET and POST requests to /books

GET, PUT, and DELETE requests can be made to /books/{id}

Request body needs to be JSON and formatted:

{"title": "Pride and Prejudice",
"author": Jane_Austen,
"done": true,
"rating": 7}

Get all books

GET /books

Get single book by a specific author

GET /books/:id

Create a book

Format:

{
  title: *string*,
  author: *string*,
  done: *boolean*,
  rating: *number*
 }  

"done" refers to whether you have finished reading the book and takes a boolean as a value.

  • All fields are required
POST /books

Update a book

Format:

{
  title: *string*,
  author: *string*,
  done: *boolean*,
  rating: *number*
 }  
PUT /books/:id
PATCH /books/:id

Remove a book

DELETE /books/:id

hapi2's People

Contributors

yvonnehayes avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.