This repository is now officially released under the MIT License. See the LICENSE file for details.
A simple microservice for generating QR codes that link to product pages. Built with Node.js, Express, TypeScript, and the qrcode library.
git clone https://github.com/jkthysse/qr-service.git
cd qr-servicenpm installA default tsconfig.json is already included.
Source lives in src/ and build output goes to dist/.
npx ts-node src/index.tsnpm run build # runs tsc
node dist/index.jsGET /qr?productId=<id>
Query params:
productId(string, required): Unique product identifier
Response:
200 OK→ PNG QR code image400 Bad Request→ Missing/invalidproductId500 Internal Server Error→ Failed to generate QR
Example:
GET http://localhost:3000/qr?productId=12345
Returns a QR code pointing to:
https://cms.thysse.org/product/12345
Interactive API docs are available via Swagger UI:
You can view, test, and explore all endpoints here.
You can import the OpenAPI (Swagger) spec directly into Postman:
- Start the server (
npx ts-node src/index.tsornpm run dev). - In Postman, click Import > Link and enter:
http://localhost:3000/swagger.json - Postman will create a collection with all documented endpoints for automation and testing.
qr-service/
├── src/
│ └── index.ts # Entry point (Express app)
├── dist/ # Compiled JS (after build)
├── package.json
├── tsconfig.json
└── README.md
- Support multiple output formats (PNG, SVG, Base64).
- Add logging & monitoring.
- Integrate with product database.
- Optional auth on QR API.