sonyafar / best-boss-quotes-api

Just a simple JSON API that returns Michael Scott quotes that can be retrieved and rendered in a front-end application

Home Page:https://best-boss-quotes-api.sonyafar.workers.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

best-boss-quotes-api

Just a simple JSON API that returns Michael Scott quotes that can be retrieved and rendered in a front-end application. The Access-Control-Allow-Origin header is set to * so that you can make requests from any domain.

Built with Cloudflare Workers.

APIs

GET /

Returns a random quote:

{
    "quote":"Saved a life. My own. Am I a hero? I really can't say, but yes."
}

GET /quotes/<count>

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

[
    "I don't want any special treatment, Pam. I just want you to treat me like you would some family member who's undergone some sort of serious physical trauma. I don't think that's too much to ask?",
    "Nobody likes beets, Dwight! Why don't you grow something that everybody does like? You should grow candy.",
    "We do not always get what we want. Sometimes life presents us with surprises."
]

GET /quotes/search/<term>

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

[
    "Jim and I are great friends. We hang out a ton, mostly at work."
]

GET /quotes

[
    "The worst thing about prison was the dementors.",
    "I am Beyonce, always.",
    "...",
    "Is there a God? If not, what are all these churches for? And who is Jesus's dad?"
]

Development

Clone this repo and run:

  • npm install wrangler: install Wrangler locally
  • wrangler dev: start a local server

About

Just a simple JSON API that returns Michael Scott quotes that can be retrieved and rendered in a front-end application

https://best-boss-quotes-api.sonyafar.workers.dev


Languages

Language:JavaScript 100.0%