"Inspired" by https://github.com/hotheadhacker/no-as-a-service, from where I copied the list of reasons as well.
Not intended for productive usage, though requests are logged and limited by IP to 100/minute.
Build using ./build.sh -b
Run as a CLI (prints a random reason):
$ ./bin/naas
╭───────────────────────────────────────────────────────────────╮
│ │
│ 👎 I've never been so sure of anything as I am of saying no. │
│ │
╰───────────────────────────────────────────────────────────────╯
Run as a service (API and web UI):
NAAS_PORT=3939 ./bin/naas -serve
Run using docker-compose:
docker-compose -f docker/docker-compose.yml up
This will start the service with the -serve
flag automatically.
The service includes a simple web UI for exploring the reasons interactively. Open your browser and navigate to http://localhost:3939 (or the port you configured) after starting the service. The UI is served from the root path (/
) and allows you to get random reasons with a button click.
/no
returns a JSON object with a random reason./ping
returns status 200 (for health check)./version
returns a JSON object with version info./debug
(when started with environmentNAAS_DEBUG=true
) exposes thepprof
endpoints.
Example Request:
GET /no
Example response:
{
"reason": "I've never been so sure of anything as I am of saying no."
}