A sample of REST web service project using Java and Gradle
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
src/main
.gitignore
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

REST webservice with Gradle

A simple example associated with my blog post.

In this project, PostgreSQL database is used to persist data. So, make sure to install it and replace your own database credentials in NoteDatabase.java file. That is my mistake to make it more completed.

Run

$ ./gradlew appRun

APIs

  • Get all notes
    • Method: GET
    • URL: localhost:8080/api/v1/notes
    • Response body data type: Plain Text
    • Success code: 200 Ok
  • Add new note
    • Method: POST
    • URL: localhost:8080/api/v1/notes
    • Success code: 201 Created
  • Get a note
    • Method: GET
    • URL: localhost:8080/api/v1/notes/{noteId}
    • Response body data type: Plain Text
    • Success code: 200 Ok
  • Update a note
    • Method: PUT
    • URL: localhost:8080/api/v1/notes/{noteId}
    • Request body data type: Plain Text
    • Response body data type: Plain Text
    • Success code: 200 Ok
  • Delete a note
    • Method: DELETE
    • URL: localhost:8080/api/v1/notes/{noteId}
    • Success code: 204 No Content