Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamesseanwright/ron-swanson-quotes
Node.js server for providing Ron Swanson quotes
https://github.com/jamesseanwright/ron-swanson-quotes
parks-and-recreation quotes ron-swanson
Last synced: 29 days ago
JSON representation
Node.js server for providing Ron Swanson quotes
- Host: GitHub
- URL: https://github.com/jamesseanwright/ron-swanson-quotes
- Owner: jamesseanwright
- License: apache-2.0
- Created: 2015-01-14T23:16:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T16:34:13.000Z (about 2 years ago)
- Last Synced: 2024-10-31T00:04:43.440Z (about 1 month ago)
- Topics: parks-and-recreation, quotes, ron-swanson
- Language: TypeScript
- Homepage: https://ron-swanson-quotes.herokuapp.com/v2/quotes
- Size: 81.1 KB
- Stars: 298
- Watchers: 7
- Forks: 38
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- my-awesome-github-stars - jamesseanwright/ron-swanson-quotes - Node.js server for providing Ron Swanson quotes (TypeScript)
README
# Ron Swanson quotes API
Because Ron Swanson is a hero. Just a ridiculously simple Node.js server.
## Production host
[https://ron-swanson-quotes.herokuapp.com/v2/quotes](http://ron-swanson-quotes.herokuapp.com/v2/quotes)
The `Access-Control-Allow-Origin` header is set to `*` so that you can make requests from any domain.
## APIs
### `GET /v2/quotes`
Returns an array with one quote:
```json
[
"Capitalism: God’s way of determining who is smart and who is poor."
]
```### `GET /v2/quotes/`
Returns an array with `` quotes e.g. `GET /quotes/2`
```json
[
"Capitalism: God’s way of determining who is smart and who is poor.",
"Clear alcohols are for rich women on diets."
]
```### `GET /v2/quotes/search/`
Returns an array of quotes matching `` without case sensitivity e.g. `GET /quotes/search/hate`
```json
[
"There's only one thing I hate more than lying: skim milk. Which is water that's lying about being milk.",
"I hate everything."
]
```## OpenAPI 3 Schema
An [OpenAPI](https://swagger.io/docs/specification/about/) 3 schema is available at `/v2/schema`. Thanks to [Chris Gali](https://github.com/chrisgali01) for the suggestion and the initial draft.
## JavaScript demo
[JSFiddle](http://jsfiddle.net/7g2w4dhc/27/) (requires a browser with support for `Promise`s, ES6, `fetch`, and generator functions.)
## Hubot integration
I wrote a Hubot script that can be installed via npm. See the [repo](https://github.com/jamesseanwright/hubot-swanson) for more details.
## Local development
Once you've cloned this repo, run `npm i` to install the dependencies.
Then you can run:
* `npm run build`: builds the TypeScript source code
* `npm start`: runs the compiled server