Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Latest commit

 

History

History
40 lines (26 loc) · 777 Bytes

README.md

File metadata and controls

40 lines (26 loc) · 777 Bytes

Building Sites with Hapi

Initial Files

  • package.json, server file, .gitignore

Basic Static File Server

  • Install hapi
  • Install inert
  • npm start

Deploying To Heroku

  • Using Heroku's port
  • Creating Heroku app

Creating a Basic JSON api

  • Create a basic GET and POST api
  • POST with CURL - curl --data "description=wat" http://localhost:8000/api/todo

Adding PUT and DELETE to the api

  • Add PUT and DELETE
  • PUT with CURL - curl -X PUT -d isComplete=false -d description=new http://localhost:8000/api/todo/538350

Building Out a Basic UI

Errors

  • Install joi
  • Create validation schema
  • Install boom
  • Use Boom for errors

Mongo Integration

  • Get Mongo running
  • Install mongodb npm package
  • Remove PUT because we don't need it