Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

orobogenius/UserManager

Open more actions menu
 
 

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.

You can find the original repository here.

Development

This application was developed using ExpressJS. MongoDB was used for persisting data with Mongoose as ORM. The app runs on top of docker containers.

Installation

  • Start up your terminal
  • Clone this repository by running git clone https://github.com/orobogenius/UserManager.git
  • Change into the app directory using cd UserManager.
  • Run the build script with sudo access sudo ./build.sh to bootstrap the application.
  • Visit http://localhost:3000/users.

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: john.doe@gmail.com
password: johndoe
HTTP Response
  • HTTP Status: 201: created
  • JSON data
{
  "_id": "59071791b0lkscm2325794",
  "name": "John Doe",
  "email": "john.doe@gmail.com",
  "password": "johndoe",
  "__v": 0
}
GET HTTP Response
  • GET /users
[
    {
        "_id": "59071791b0lkscm2325794",
        "name": "John Doe",
        "email": "john.doe@gmail.com",
        "password": "johndoe",
        "__v": 0
    }
]
GET HTTP Response
  • GET /users/:id
{
    "_id": "59071791b0lkscm2325794",
    "name": "John Doe",
    "email": "john.doe@gmail.com",
    "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: jane.doe@gmail.com
password: janedoe
HTTP Response
  • HTTP Status: 200: OK
  • JSON data
{
  "_id": "59071791b0lkscm2325794",
  "name": "Jane Doe",
  "email": "jane.doe@gmail.com",
  "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

 
 
 

Contributors

Languages

  • Shell 51.1%
  • JavaScript 48.9%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.