Skip to content

Harsha41-dev/NOTES-CRUD--API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

History
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes API

A simple CRUD API for note making using MongoDB and Express.

Setup

  1. Install dependencies:
npm install
  1. Make sure MongoDB is running locally or update the connection string in index.js to your MongoDB URI.

  2. Start the server:

npm start

The server will run on port 3000 by default.

API Endpoints

  • POST /notes - Create a new note.
    Request body example:

    {
      "title": "Sample Note",
      "content": "This is a sample note."
    }
  • GET /notes - Get all notes.

  • GET /notes/:id - Get a note by ID.

  • PUT /notes/:id - Update a note by ID.
    Request body can include fields to update, e.g. title or content.

  • DELETE /notes/:id - Delete a note by ID.

Notes

  • The API uses MongoDB with Mongoose ODM.
  • The note schema includes title (required), content, and createdAt fields.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors