Skip to content

jiggabyte/UserManager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

User Manager

This repository contains a simple demo API built with NodeJS. The API is used to manage users in a MongoDB database.

Development

This application was developed using ExpressJS. MongoDB was used for persisting data with Mongoose as ORM.

Installation

  • Start up your terminal (or Command Prompt on Windows OS).
  • Ensure that you've docker installed on your PC.
  • Clone the repository by entering the command git clone https://github.com/Jiggabyte/UserManager in the terminal.
  • Navigate to the project folder using cd UserManager on your terminal (or command prompt)
  • After cloning, type in terminal prompt 'bash deploy'.

Testing

To ensure that your installation is successful you'll need to run tests. The command: npm test makes this possible. It isn't functional right now, but once it's done you'll be notified via the README.

API Documentation

The API only has one endpoint which is the /users endpoint for saving users to the database. The endpoint works with the HTTP verbs: POST, GET, PUT, DELETE.

POST HTTP Request
  • POST /users
  • INPUT:
name: John Doe
email: [email protected]
password: johndoe
HTTP Response
  • HTTP Status: 201: created
  • JSON data
{
  "_id": "59071791b0lkscm2325794",
  "name": "John Doe",
  "email": "[email protected]",
  "password": "johndoe",
  "__v": 0
}
GET HTTP Response
  • GET /users
[
    {
        "_id": "59071791b0lkscm2325794",
        "name": "John Doe",
        "email": "[email protected]",
        "password": "johndoe",
        "__v": 0
    }
]
GET HTTP Response
  • GET /users/:id
{
    "_id": "59071791b0lkscm2325794",
    "name": "John Doe",
    "email": "[email protected]",
    "password": "johndoe",
    "__v": 0
}
DELETE HTTP Response
  • DELETE /users/:id
User John Doe was deleted
POST HTTP Request
  • PUT /users/:id
  • INPUT:
name: Jane Doe
email: [email protected]
password: janedoe
HTTP Response
  • HTTP Status: 200: OK
  • JSON data
{
  "_id": "59071791b0lkscm2325794",
  "name": "Jane Doe",
  "email": "[email protected]",
  "password": "janedoe",
  "__v": 0
}

Author

Olajide Bolaji 'Nuel - Software Developer at Andela

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 75.1%
  • Shell 24.9%