Giter Club home page Giter Club logo

ron-swanson-quotes's Introduction

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

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:

[
    "Capitalism: God’s way of determining who is smart and who is poor."
]

GET /v2/quotes/<count>

Returns an array with <count> quotes e.g. GET /quotes/2

[
    "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/<term>

Returns an array of quotes matching <term> without case sensitivity e.g. GET /quotes/search/hate

[
    "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 3 schema is available at /v2/schema. Thanks to Chris Gali for the suggestion and the initial draft.

JavaScript demo

JSFiddle (requires a browser with support for Promises, ES6, fetch, and generator functions.)

Hubot integration

I wrote a Hubot script that can be installed via npm. See the repo 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

ron-swanson-quotes's People

Contributors

jamesseanwright avatar aridez avatar aekong avatar kieranbarker avatar brodan avatar shevabam avatar ullenius avatar nemanjaglumac avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.