Skip to content

This is an user management API which consists of all api requests that can be send to user using postman or any api request extensions. In this each api request is authenticated using JWT . The testing was done by using jest and supertest tools and the data validation is done by a joi module.

License

Notifications You must be signed in to change notification settings

Navaneeth-21/Worko-User-Management-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Worko API

Getting Started

Prerequisites

  • Node.js
  • MongoDB
  • jest
  • supertest
  • JWT
  • joi(validation)

Installation

  1. Clone the repository:

    git clone https://github.com/navaneethgade07/Worko_Backend_api_setup.git
    cd worko
  2. Install dependencies:

    npm install
  3. Create a .env file in the root directory with the following content:

    PORT=3000
    DB_URL=mongodb://localhost:27017/worko
    JWT_SECRET=your_secret_key
  4. Start the server:

    npm start
  5. Api requests :

    • Send all api requests using postman or thunderclient extension in vscode.
    • For POST request send the required details to create a user.
    • For GET request(listallusers) you can retrieve the all the user details in the database.
    • For GET request(getuser) to retrieve a user by its userID.
    • PUT request to replace the whole existing data with the updated data.
    • PATCH request to update the existing data with the optional data.
    • DELETE request to soft delete a user by it's userID.

Running Tests

npm test

About

This is an user management API which consists of all api requests that can be send to user using postman or any api request extensions. In this each api request is authenticated using JWT . The testing was done by using jest and supertest tools and the data validation is done by a joi module.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published