Skip to content

dk-e/yes-no-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βœ…βŒ Yes/No Reason API

A simple API that provides random "yes" or "no" reasons. Perfect for adding a touch of randomness to your responses 😊


πŸš€ API Usage

This API is designed to be straightforward to use.

Base URL

When self-hosting, the base URL will typically be http://localhost:3000.

Endpoints

Endpoint Method Description
/yes GET Returns a random "yes" reason.
/no GET Returns a random "no" reason.

βœ… Example Request (GET /yes)

GET /yes

βœ… Example Response (GET /yes)

{
  "reason": "Because today is the day!"
}

❌ Example Request (GET /no)

GET /no

❌ Example Response (GET /no)

{
  "reason": "The timing isn't right."
}

πŸ› οΈ Self-Hosting

Want to run this API yourself? It's easy with Bun and TypeScript.

Prerequisites

  • Bun installed on your system.

Steps

  1. Clone this repository (or create the files manually):

    git clone https://github.com/dk-e/yes-no-api
    cd yes-no-api
  2. Install dependencies:

    bun install
  3. Start the server:

    bun run index.ts

The API will be live at:

  • Yes Reason: http://localhost:3000/yes
  • No Reason: http://localhost:3000/no

🌐

  • The api will be available to be used at: https://y-n.daniel.rest

About

🎲 Returns a random yes or no reason

Resources

Stars

Watchers

Forks