https://github.com/theforps/notes-go_rest
Simple REST API for taking notes
https://github.com/theforps/notes-go_rest
go notes rest-api
Last synced: 9 months ago
JSON representation
Simple REST API for taking notes
- Host: GitHub
- URL: https://github.com/theforps/notes-go_rest
- Owner: theforps
- Created: 2025-09-20T16:30:36.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-09-20T17:23:25.000Z (10 months ago)
- Last Synced: 2025-09-20T18:29:14.172Z (10 months ago)
- Topics: go, notes, rest-api
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## 📝 Notes API Documentation
This API allows you to perform CRUD operations on notes.
### Base URL
```
http://localhost:5050
```
---
### 📌 Endpoints
---
### 1. Get All Notes
* **URL:** `/get-notes`
* **Method:** `GET`
* **Description:** Retrieves a list of all notes.
* **Response:**
```json
{
"notes": [
{
"id": 1,
"title": "Example Title",
"description": "Example Description"
}
]
}
```
---
### 2. Get Note by ID
* **URL:** `/get-note/:id`
* **Method:** `GET`
* **Description:** Retrieves a single note by its ID.
* **Path Parameters:**
* `id` (integer) — ID of the note.
* **Response:**
```json
{
"note": {
"id": 1,
"title": "Example Title",
"description": "Example Description"
}
}
```
---
### 3. Create Note
* **URL:** `/add-note`
* **Method:** `POST`
* **Description:** Creates a new note.
* **Request Body:**
```json
{
"title": "New Note Title",
"description": "New Note Description"
}
```
* **Response:**
```json
"Success"
```
---
### 4. Update Note
* **URL:** `/update-note/:id`
* **Method:** `PUT`
* **Description:** Updates an existing note by ID.
* **Path Parameters:**
* `id` (integer) — ID of the note to update.
* **Request Body:**
```json
{
"title": "Updated Note Title",
"description": "Updated Note Description"
}
```
* **Response:**
```json
"Success"
```
---
### 5. Delete Note
* **URL:** `/delete-note/:id`
* **Method:** `DELETE`
* **Description:** Deletes a note by ID.
* **Path Parameters:**
* `id` (integer) — ID of the note to delete.
* **Response:**
```json
"Success"
```
---
### ⚠️ Error Handling
* Returns `400 Bad Request` if:
* The `id` parameter is not a valid integer.
* The request body is not properly formatted JSON.