Skip to content

bugparty/cloudflare_worker_quotes_api

Repository files navigation

🌟 Quotes API — Powered by Cloudflare Workers

A fast and lightweight quote API built using Cloudflare Workers and Hono, storing data via D1 and Prisma.

🔗 Live API Endpoint

You can fetch a random quote with the following endpoint:

GET https://quotes.0xff.workers.dev/quote/random

Returns:

{
  "id": 1,
  "text": "The only limit to our realization of tomorrow is our doubts of today.",
  "author": "Franklin D. Roosevelt"
}

🚀 Getting Started

1. Prerequisites

  • Node.js (>=18 recommended)
  • Cloudflare Wrangler: npm install -g wrangler
  • Prisma CLI: npm install -g prisma

2. Install dependencies

npm install

3. Development server

npm run dev

This will start a local Cloudflare Worker using wrangler dev.

4. Deploy to Cloudflare

npm run deploy

⚙️ Load Testing

To run performance tests using Artillery:

  1. Install globally:
    npm install -g artillery
  2. Use your .yml or command line to simulate traffic (you can customize it as needed).

📌 Roadmap / TODO

  • Schedule quote-fetching from external APIs using Cloudflare Cron Triggers.
  • Add pagination and search capabilities.
  • Rate limiting or API key authentication (optional).

🧱 Built With


📂 Project Structure

├── index.ts           # Main Worker code
├── package.json       # Project configuration
├── README.md          # You're reading it!

🧪 Type Checking

Generate Cloudflare types (optional):

npm run cf-typegen

📝 License

MIT — feel free to use, contribute, or fork this project!


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published