Frank John Begornia c38837b552 first commit
2026-04-02 14:58:00 +08:00
2026-04-02 14:58:00 +08:00
2026-04-02 14:58:00 +08:00
2026-04-02 14:58:00 +08:00
2026-04-02 14:58:00 +08:00
2026-04-02 14:58:00 +08:00
2026-04-02 14:58:00 +08:00
2026-04-02 14:58:00 +08:00
2026-04-02 14:58:00 +08:00
2026-04-02 14:58:00 +08:00

QR Code API (Node.js)

Simple micro app that returns a QR code image from an API call.

Setup

npm install

Run

npm run dev
# or
npm start

Default URL: http://localhost:3000

Endpoints

  • GET /health
  • GET /api/qr?text=Hello%20World
  • POST /api/qr with JSON body

GET example

curl "http://localhost:3000/api/qr?text=Hello%20World&size=400" --output qr.png

POST example

curl -X POST "http://localhost:3000/api/qr" \
  -H "Content-Type: application/json" \
  -d '{"text":"https://crewsportswear.app","size":500,"margin":2}' \
  --output qr.png

Optional parameters

  • size (number, default 512, min 128, max 2048)
  • margin (number, default 2, min 0, max 10)
  • dark (hex color, default #000000)
  • light (hex color, default #FFFFFF)

Docker

Local Docker run

docker compose -f docker-compose.local.yml up -d --build

Local URL: http://localhost:3000

Production (Traefik)

docker compose -f docker-compose.prod.yml up -d --build

Traefik host rule: qr.crewsportswear.app

Notes:

  • Uses external Docker networks: traefik-public and crew-app-net
  • Internal service port is 3000
  • Includes HTTP -> HTTPS redirect via Traefik labels
Description
No description provided
Readme 49 KiB
Languages
JavaScript 90.2%
Dockerfile 9.8%