pcbjam/web/backend/package.json
Istvan Matejcsok 21e6f4c2d5 harden the reference backend: write bounds + CORS
The @pcbjam/backend-example server had a 1 GiB body limit, no per-owner/per-lib
quotas, bound to 0.0.0.0, and reflected any origin with credentials when
CORS_ORIGIN is *. Bound the write surface (5 MiB body cap, per-owner lib and
per-lib item quotas), bind 127.0.0.1 by default (opt in via HOST), and force
credentials off for a wildcard CORS origin. Refactor main() into an exported
buildApp() and add web/backend/test/security.test.ts (inject-based).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 12:46:17 +02:00

27 lines
822 B
JSON

{
"name": "@pcbjam/backend-example",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "tsx src/extract/ensure-example-libs.ts && tsx watch src/server.ts",
"start": "tsx src/extract/ensure-example-libs.ts && tsx src/server.ts",
"ensure-libs": "tsx src/extract/ensure-example-libs.ts",
"extract-libs": "tsx src/extract/extract-libs.ts",
"build": "tsc -p tsconfig.json --noEmit false --declaration false --outDir dist",
"typecheck": "tsc --noEmit",
"test": "vitest run"
},
"dependencies": {
"@fastify/cors": "^9.0.1",
"@pcbjam/shared": "workspace:*",
"@ts-rest/fastify": "^3.52.1",
"fastify": "^4.29.0"
},
"devDependencies": {
"@types/node": "^22.10.5",
"tsx": "^4.19.2",
"typescript": "^5.7.3",
"vitest": "^3.2.6"
}
}