This is a notes app API that allows users to authenticate and manage their notes. It is built using Node.js, Express, and MongoDB. This backend is for the frontend available here.
- Node.js
- MongoDB
-
Install the dependencies:
npm install
-
Create a
.envfile in the root directory and add the following environment variables:PORT=8000 CONNECTION_STRING=your_mongodb_connection_string JWT_SECRET=your_jwt_secret
-
Start the server:
npm start
The server will start on
http://localhost:8000.
- Description: Register a new user.
- Body Parameters:
name(string, required)email(string, required)password(string, required)
- Description: Login a user.
- Body Parameters:
email(string, required)password(string, required)
- Description: Get the user profile.
- Headers:
Authorization: Bearer<token>
- Description: Create a new note.
- Headers:
Authorization: Bearer<token>
- Body Parameters:
title(string, required)content(string, required)
- Description: Update a note.
- Headers:
Authorization: Bearer<token>
- Body Parameters:
title(string, optional)content(string, optional)tags(array of strings, optional)isPinned(boolean, optional)
- Description: Get all notes.
- Headers:
Authorization: Bearer<token>
- Description: Delete a note.
- Headers:
Authorization: Bearer<token>
- Description: Pin a note.
- Headers:
Authorization: Bearer<token>
- Description: Search notes by title or content.
- Headers:
Authorization: Bearer<token>
- Query Parameters:
query(string, required)