Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vincentdoerig/rowing-quotes-api
A JSON API for quotes related to rowing.
https://github.com/vincentdoerig/rowing-quotes-api
quote-generator quotes rest-api rowing
Last synced: about 2 months ago
JSON representation
A JSON API for quotes related to rowing.
- Host: GitHub
- URL: https://github.com/vincentdoerig/rowing-quotes-api
- Owner: vincentdoerig
- License: mit
- Created: 2019-07-10T09:54:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T21:57:35.000Z (about 2 years ago)
- Last Synced: 2024-10-12T21:07:08.555Z (3 months ago)
- Topics: quote-generator, quotes, rest-api, rowing
- Language: JavaScript
- Homepage: https://rowing-quotes-api.herokuapp.com
- Size: 210 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rowing Quotes API
> An API for quotes related to rowing created with Node.js.
## Usage
### Get a random quote
Returns a single random quote from the database
#### Request
```http
https://rowing-quotes-api.herokuapp.com/random
```
#### Response
```ts
{
"id": number,
"quote": string,
"author": string,
"additionalInfo": string
}
```### Get x amount of quotes
```http
https://rowing-quotes-api.herokuapp.com/random/:amount
```### Get the quote with the id of x
```http
https://rowing-quotes-api.herokuapp.com/quote/:id
```### Get all the available quotes
```http
https://rowing-quotes-api.herokuapp.com/all
```## Examples
**Get a random quote using fetch**
```js
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**
```js
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}`)
}
```## Development
### Install
```console
$ yarn install
```### Deployment
```console
$ yarn start
```### Development
```console
$ yarn dev
```## Contributing
Pull requests and feedback are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
[MIT](https://github.com/vincentdoerig/rowing-quotes-api/blob/master/LICENSE)