Skip to content

Bartek-Figat/Hapi--Mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeFactor

Hapi-Mongodb


Installation

$ npm i -S
$ npm run watch:server

Built With

  • node.js
  • @hapi/hapi
  • mongodb

Application will run by default on port:8080


API


Function name Description
get() "/"
post() "/post"
get() "/pagination"

Folder Structure

app
├── config                      # Environment Specific Variables (local/dev/production)
   └── config.js

├── controllers                 # Controllers (functions)
   └── db.controllers.js


├── models                      # Models (usually database models)
   └── models.schema.js

├── routes                      # Routing (Routing refers to how an application’s endpoints (URIs) respond to client requests)
   └── index.router.js

├── .env                        # Env (The process.env property returns an object containing the user environment)


├── .gitignore                  # Gitignore (specifies intentionally untracked files to ignore)

├──  package.json               # Project Description & Dependencies


├──  server.js                  # Index (your server starts here)

Insert JSON Data

  {

    "isActive": true,
    "age": 38,
    "eyeColor": "green",
    "company": "ZENTIME"
  },
  {

    "isActive": false,
    "age": 26,
    "eyeColor": "brown",
    "company": "EXOTERIC"
  },
  {

    "isActive": false,
    "age": 26,
    "eyeColor": "green",
    "company": "ZIPAK"
  },
  {

    "isActive": true,
    "age": 25,
    "eyeColor": "brown",
    "company": "REMOTION"
  },
  {

    "isActive": false,
    "age": 29,
    "eyeColor": "brown",
    "company": "COWTOWN"
  },
  {

    "isActive": false,
    "age": 22,
    "eyeColor": "brown",
    "company": "OVATION"
  },
  {

    "isActive": true,
    "age": 25,
    "eyeColor": "green",
    "company": "PHEAST"
  },
  {

    "isActive": true,
    "age": 23,
    "eyeColor": "blue",
    "company": "GRONK"
  },
  {

    "isActive": false,
    "age": 30,
    "eyeColor": "green",
    "company": "GEOLOGIX"
  },
  {

    "isActive": true,
    "age": 23,
    "eyeColor": "brown",
    "company": "RONELON"
  },

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published