An API for quotes related to rowing created with Node.js.
Returns a single random quote from the database
https://rowing-quotes-api.herokuapp.com/random
{
"id": number,
"quote": string,
"author": string,
"additionalInfo": string
}
https://rowing-quotes-api.herokuapp.com/random/:amount
https://rowing-quotes-api.herokuapp.com/quote/:id
https://rowing-quotes-api.herokuapp.com/all
Get a random quote using fetch
fetch('https://rowing-quotes-api.herokuapp.com/random')
.then(response => response.json())
.then(data => {
console.log(`${data.quote} —${data.author}`)
})
Get a random quote unsing async/await
async function randomQuote() {
const response = await fetch('https://rowing-quotes-api.herokuapp.com/random')
const data = await response.json()
console.log(`${data.quote} —${data.author}`)
}
$ yarn install
$ yarn start
$ yarn dev
Pull requests and feedback are welcome. For major changes, please open an issue first to discuss what you would like to change.