https://github.com/palashmon/learn-hapijs
A simple REST API using Hapi.js and MongoDB
https://github.com/palashmon/learn-hapijs
crud hapi hapijs mongodb rest-api
Last synced: 2 months ago
JSON representation
A simple REST API using Hapi.js and MongoDB
- Host: GitHub
- URL: https://github.com/palashmon/learn-hapijs
- Owner: palashmon
- Created: 2020-07-21T05:12:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T17:37:48.000Z (almost 2 years ago)
- Last Synced: 2024-04-30T18:49:45.107Z (almost 2 years ago)
- Topics: crud, hapi, hapijs, mongodb, rest-api
- Language: JavaScript
- Homepage: https://hapi.dev/
- Size: 10.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Learn Hapi.js
A simple REST API using Hapi.js and MongoDB
## Usage
### Installation
Clone the repo and install npm module
```sh
npm install
```
### Run app
```sh
npm start
```
### Routes
| Description | Http | URL | Body |
| ----------- | ------ | --------------------------------- | ------------------------------------------------- |
| Create | POST | http://localhost:3000/person | `{ "firstName": "Palash", "lastName": "Mondal" }` |
| Read All | GET | http://localhost:3000/people | - |
| Read One | GET | http://localhost:3000/person/{id} | - |
| Update | PUT | http://localhost:3000/person/{id} | `{ "firstName": "Pal" }` |
| Delete | DELETE | http://localhost:3000/person/{id} | - |
### Links
- [Getting Started](https://hapi.dev/tutorials/gettingstarted/?lang=en_US)
- [Express Migration](https://hapi.dev/tutorials/expresstohapi/?lang=en_US)
- [Routing](https://hapi.dev/tutorials/routing/?lang=en_US)
- [Community support options](https://hapi.dev/support/)