Skip to content

code-reaper08/sample_backend_for_react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Documentation

npm install

Give this command in terminal and then change the MonogDb url in index.js and you are set to go

Base URL

The base URL for all API endpoints is http://localhost:4000.

User Routes

Create a User

  • Endpoint: /users
  • Method: POST
  • Description: Create a new user.
  • Request Body:
    • name (string, required): The user's name.
    • email (string, required): The user's email address.
    • username (string, required): The user's username.

Get a User by ID

  • Endpoint: /users/:id
  • Method: GET
  • Description: Retrieve a user by their unique identifier.
  • URL Parameters:
    • id (string)

Get All Users

  • Endpoint: /users
  • Method: GET
  • Description: Retrieve a list of all users.

Edit a User Data

  • Endpoint: /users/:id
  • Method: PUT
  • Description: Update a user's information.
  • URL Parameters:
    • id (string)
  • Request Body:
    • Body:
      • name (string): The updated user's name (optional).
      • email (string): The updated user's email address (optional).
      • username (string): The updated user's password (optional).

Delete a User

  • Endpoint: /users/:id
  • Method: DELETE
  • Description: Delete a user by their unique identifier.
  • URL Parameters:
    • id (string)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •