SnapAPI/package.json
SnapAPI CEO 713cc30ac7
Some checks failed
Deploy to Staging / build-and-deploy (push) Failing after 10m13s
fix: code-driven OpenAPI docs — replace static JSON with swagger-jsdoc
BREAKING: OpenAPI spec is now generated from JSDoc annotations on route
handlers at startup, eliminating drift between code and documentation.

What was wrong:
- Static public/openapi.json was manually maintained and could drift
- Missing endpoints: signup, billing (checkout/success/webhook)
- Signup route was imported but never mounted (dead code)

What was fixed:
- Added swagger-jsdoc to generate OpenAPI spec from JSDoc on route files
- Every route handler now has @openapi JSDoc annotation as source of truth
- Spec served dynamically at GET /openapi.json (no static file)
- Deleted public/openapi.json
- Documented all missing endpoints (signup, billing x3)
- Mounted /v1/signup route
- All 9 screenshot params documented with types, ranges, defaults
2026-02-20 07:32:37 +00:00

33 lines
810 B
JSON

{
"name": "snapapi",
"version": "0.1.0",
"description": "URL to Screenshot API — PNG, JPEG, WebP via simple REST API",
"main": "dist/index.js",
"type": "module",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"dev": "tsx src/index.ts"
},
"dependencies": {
"compression": "^1.8.1",
"express": "^4.21.0",
"express-rate-limit": "^7.5.0",
"helmet": "^8.0.0",
"nanoid": "^5.0.0",
"pg": "^8.13.0",
"pino": "^10.3.1",
"puppeteer": "^24.0.0",
"stripe": "^17.0.0",
"swagger-jsdoc": "^6.2.8"
},
"devDependencies": {
"@types/compression": "^1.8.1",
"@types/express": "^5.0.0",
"@types/node": "^22.0.0",
"@types/pg": "^8.0.0",
"@types/swagger-jsdoc": "^6.0.4",
"tsx": "^4.0.0",
"typescript": "^5.6.0"
}
}