Skip to main content

The Joke API

CI Code Coverage

A blazing fast jokes REST API made with Oak on Deno Deploy 🦕 🚀

API

GET /

https://joke.deno.dev

Get a random joke ✨

{
  "id": 229,
  "type": "general",
  "setup": "What do you call an alligator in a vest?",
  "punchline": "An in-vest-igator!"
}

GET /:id

https://joke.deno.dev/350

Did you like a joke? Get the same whenever you want 🦀

{
  "id": 350,
  "type": "general",
  "setup": "Why did the tree go to the dentist?",
  "punchline": "It needed a root canal."
}

GET /type/:type

https://joke.deno.dev/type/programming

Looking for a specific type of jokes? You’re lucky 🐌

[
  {
    "id": 15,
    "type": "programming",
    "setup": "What's the best thing about a Boolean?",
    "punchline": "Even if you're wrong, you're only off by a bit."
  },
  {
    "id": 16,
    "type": "programming",
    "setup": "What's the object-oriented way to become wealthy?",
    "punchline": "Inheritance"
  },
  ...
]

All available types are listed on GET /type 🕵️‍♂️

Contributing

Submit a Pull Request, with your joke added to the server/data.ts file. Make sure your joke is in this format:

{
  "id": last joke id + 1,
  "type": "programming",
  "setup": "What's the best thing about a Boolean?",
  "punchline": "Even if you're wrong, you're only off by a bit."
}

If you have an idea for a new endpoint, submit an issue or a pull request.

Licence

Licensed under the MIT License 📄