Skip to content

Java Spring Boot RESTful web service for random quotes.

Notifications You must be signed in to change notification settings

ianagpawa/random-quotes-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Quote API

Java Spring Boot restful web service for my favorite quotes.

Download source code.

Clone repo: git clone https://github.com/ianagpawa/random-quote-api.git

Local Development

Prerequesites

Windows

Install Java 11 SE :

Install Gradle:

Dependencies

  • Spring Web
  • Spring Data JPA
  • H2 Database

Build project

In terminal, navigate to folder director and use the following command to build the project:

gradle build

Clean build

In terminal, navigate to folder director and use the following command to perform a clean build of the project:

gradle clean build

Run service locally

In terminal, navigate to folder director and use the following command to run the service locally on port 8080.

gradle bootRun

Retrieve all quotes

curl -v localhost:8080/quotes

Retrieve random quote

curl -v localhost:8080/random

Retrieve quote by id

curl -v localhost:8080/quotes/{id}

Add new quote

curl -X POST localhost:8080/quotes -H 'Content-type:application/json' -d '{"name": "{name}", "content": "{content}", "source": "{source}"}'

Update quote

curl -X PUT localhost:8080/quotes/{id} -H 'Content-type:application/json' -d '{"name": "{name}", "content": "{content}", "source": "{source}"}'

Delete quote

curl -X DELETE localhost:8080/quotes/{id}

Creator

Ian Agpawa [email protected]

About

Java Spring Boot RESTful web service for random quotes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages