Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes API

A simple RESTful API built with Spring Boot for creating, reading, updating, and deleting notes.

Features

  • Built with Spring Boot, Spring Data JPA, and PostgreSQL.
  • RESTful endpoints with proper HTTP status codes.
  • Simple CRUD operations for notes.

Installation

Clone the repository and install dependencies:

mvn clean install

Usage

mvn spring-boot:run     # Development
mvn package             # Production

The server runs on http://localhost:8080

API Endpoints

Get All Notes

GET /notes

Response:

[
  {
    "id": 1,
    "title": "My Note",
    "content": "This is my note content"
  }
]

Get Note by ID

GET /notes/{id}

Example:

GET /notes/1

Response:

{
  "id": 1,
  "title": "My Note",
  "content": "This is my note content"
}

Create Note

POST /notes

Request Body:

{
  "title": "New Note",
  "content": "Note content here"
}

Response:

{
  "id": 1,
  "title": "New Note",
  "content": "Note content here"
}

Update Note

PUT /notes/{id}

Example:

PUT /notes/1

Request Body:

{
  "title": "Updated Title",
  "content": "Updated content"
}

Response:

{
  "id": 1,
  "title": "Updated Title",
  "content": "Updated content"
}

Delete Note

DELETE /notes/{id}

Example:

DELETE /notes/1

Response: 204 No Content

About

Spring Boot Notes API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages