A simple CRUD sample using Hapi v17.
- Having an enormous revision on the release of v17, this sample code can serve as a guide on creating a simple CRUD using hapi v17. This code uses postgreSQL as database.
- Create a table named 'promise' with columns 'id' as primary key and 'name' on your postgre db.
- run npm start.
- url - http://localhost:8000/create
- method - post
- Body
{
"name": "luke"
}
- url - http://localhost:8000/read/{id}
- method - get
- url - http://localhost:8000/update/{id}
- method - patch or put
- Body
{
"name": "chewy"
}
- url - http://localhost:8000/delete/{id}
- method - delete