Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NoFree.dev

A static site and public API for declining requests for free work. Inspired by nohello.com.

Live Site: https://nofree.dev API Base URL: https://api.nofree.dev

Overview

NoFree.dev provides a standard link to set boundaries with clients or friends asking for unpaid labor. It includes a functional JSON API built on Cloudflare Workers that serves refusal messages with varying levels of intensity.

API Documentation

The API allows you to fetch messages, submit new ones, and vote on existing entries.

1. Get a Message

Fetch a random refusal message.

Endpoint: GET /

Parameters:

  • intensity (optional): Integer 1-10.
    • 1-4: Professional / Polite
    • 5-7: Firm / Direct
    • 8-10: Rude / Aggressive

Example Request:

curl "https://api.nofree.dev/?intensity=10"

Example Response:

{
  "id": 42,
  "content": "Read my lips: Pay me.",
  "intensity": 10,
  "votes": 150
}

2. Get Specific Message

Fetch a refusal by its unique ID.

Endpoint: GET /{id}

Example:

curl "https://api.nofree.dev/1"

3. Submit a Message

Add a new refusal to the database.

Endpoint: POST /submit

Body:

{
  "content": "I do not code for exposure.",
  "intensity": 5
}

4. Upvote

Upvote a message by ID.

Endpoint: POST /vote

Body:

{
  "id": 42
}

Tech Stack

  • Frontend: HTML5 / CSS3 (Hosted on GitHub Pages)
  • Backend: Cloudflare Workers (Serverless JavaScript)
  • Database: Cloudflare D1 (SQLite)

Local Development

To run the backend locally, you need npm and wrangler installed.

  1. Install Dependencies
npm install
  1. Create Database Run this command and **copy the database_id** it outputs:
npx wrangler d1 create nofree-db
  1. Configure Database Open wrangler.toml and paste the ID you just copied into the database_id field:
[[d1_databases]]
binding = "DB"
database_name = "nofree-db"
database_id = "PASTE_YOUR_ID_HERE"
  1. Apply Schema Create the tables:
npx wrangler d1 execute nofree-db --local --file=./schema.sql
  1. Deploy
npx wrangler deploy

License

MIT License.


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages