An open API service indexing awesome lists of open source software.

https://github.com/rjd06/noteapp-backend

It's a complete crud operation based notes app backend repo.
https://github.com/rjd06/noteapp-backend

cors dotenv express fetch-api javascript json mongodb mongodb-atlas mongodb-database mongoose nodejs notes-app

Last synced: 2 months ago
JSON representation

It's a complete crud operation based notes app backend repo.

Awesome Lists containing this project

README

          

# Notes App APIs Docs

- Base URL : [https://noteapp-ovs5.onrender.com](https://noteapp-ovs5.onrender.com)

## Endpoints Overview (List)

1. **GET** `/` → API status check
2. **GET** `/api/notes` → Fetch all notes
3. **POST** `/api/note/create` → Create a new note
4. **PUT** `/api/note/update/:id` → Update note by ID
5. **DELETE** `/api/note/delete/:id` → Delete note by ID

## With Fetch Method
- Home Route
```js
fetch("https://noteapp-ovs5.onrender.com/")
.then(res => res.text())
.then(data => console.log(data));
```

- Get All Notes
```js
fetch("https://noteapp-ovs5.onrender.com/api/notes")
.then(res => res.json())
.then(data => console.log(data));
```

- Response Example
```js
[
{
"_id": "68a356dbc214d34f58cac23e",
"title": "read book",
"content": "read rich dad poor dad for financial lessons.",
"isCompleted": false,
"createdAt": "2025-08-18T16:37:47.137Z",
"updatedAt": "2025-08-18T16:37:47.137Z",
"__v": 0
}
]
```

- Create a New Note
```js
fetch("https://noteapp-ovs5.onrender.com/api/note/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
title: "First Note",
content: "This is my first note"
})
})
.then(res => res.json())
.then(data => console.log(data));
```

- Update a Note
```js
fetch("https://noteapp-ovs5.onrender.com/api/note/update/68a356dbc214d34f58cac23e", {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
title: "Updated Note",
content: "This note has been updated",
isCompleted: true
})
})
.then(res => res.json())
.then(data => console.log(data));
```

- Delete a Note
```js
fetch("https://noteapp-ovs5.onrender.com/api/note/delete/68a356dbc214d34f58cac23e", {
method: "DELETE"
})
.then(res => res.json())
.then(data => console.log(data));
```

## With Axios
- Home Route
```js
import axios from "axios";

axios.get("https://noteapp-ovs5.onrender.com/")
.then(res => console.log(res.data))
.catch(err => console.error(err));
```

- Get All Notes
```js
import axios from "axios";

axios.get("https://noteapp-ovs5.onrender.com/api/notes")
.then(res => console.log(res.data))
.catch(err => console.error(err));
```

- Response Example
```js
[
{
"_id": "68a356dbc214d34f58cac23e",
"title": "read book",
"content": "read rich dad poor dad for financial lessons.",
"isCompleted": false,
"createdAt": "2025-08-18T16:37:47.137Z",
"updatedAt": "2025-08-18T16:37:47.137Z",
"__v": 0
}
]
```

- Create a New Note
```js
import axios from "axios";

axios.post("https://noteapp-ovs5.onrender.com/api/note/create", {
title: "First Note",
content: "This is my first note"
})
.then(res => console.log(res.data))
.catch(err => console.error(err));
```

- Update a Note
```js
import axios from "axios";

axios.put("https://noteapp-ovs5.onrender.com/api/note/update/68a356dbc214d34f58cac23e", {
title: "Updated Note",
content: "This note has been updated",
isCompleted: true
})
.then(res => console.log(res.data))
.catch(err => console.error(err));
```

- Delete a Note
```js
import axios from "axios";

axios.delete("https://noteapp-ovs5.onrender.com/api/note/delete/68a356dbc214d34f58cac23e")
.then(res => console.log(res.data))
.catch(err => console.error(err));
```

---

## 👨‍💻 Author
- **Name:** Rajdev Yadav
- **Role:** Software Engineering Student | MERN Stack Developer
- **GitHub:** [@beingrajdevyadav](https://github.com/beingrajdevyadav)
- **LinkedIn:** [Rajdev Yadav](https://linkedin.com/in/rjd06)