- Node.js
- MongoDB
- jest
- supertest
- JWT
- joi(validation)
-
Clone the repository:
git clone https://github.com/navaneethgade07/Worko_Backend_api_setup.git cd worko
-
Install dependencies:
npm install
-
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
-
Start the server:
npm start
-
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.
npm test