Skip to content

Latest commit

 

History

History
75 lines (49 loc) · 1.56 KB

README.md

File metadata and controls

75 lines (49 loc) · 1.56 KB

express-js-mongodb-promise-api

A simple api using express.js and mongodb with async/await

Requirements

Diagram

Alt text

Components

  • config (config.js)

    • configuration file
  • server (server.js)

    • creates server and listens on a port 3000
    • defines routes and accepts requests (routes.js)
  • controller

    • handles requests
  • service (service.js)

    • handles business logic
  • model

    • data
  • dbContext (dbContext.js)

    • handles db connection
  • database (mongodb community server)

    • mongodb database

Run

Run the following command from the root directory:

node .\server.js

Tests

Try the following urls in Postman.