Generate an OpenAPI 3.0 spec from route annotations and serve it with Swagger UI so the full REST API is browsable and testable. - Add swagger-ui-express (runtime) and swagger-autogen (dev) deps, plus an `npm run swagger` script. - server/swagger/swagger.js: generator config with API metadata, servers, 14 tag groups, cookie + bearer security schemes, and 28 reusable component schemas. Follows the Express mount chain from src/app.js so generated paths are fully-qualified (/api/v1/...). - Annotate every route (auth, mobile, sso, public, admin, health) with #swagger tags/summaries/parameters/request bodies/security and the actual response codes each handler returns (400/401/403/404/409/429/ 302/502, multipart uploads). - Serve Swagger UI at /api/docs and the raw spec at /api/docs.json, guarded so a missing spec disables docs instead of crashing. - Commit the generated swagger-output.json so docs work with no build step; swagger-autogen stays dev-only and is not needed at runtime. - README: new "API documentation (Swagger)" section plus tech-stack and project-structure entries. Covers 51 paths / 64 operations. Existing test suite (83) still passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
46 lines
1.1 KiB
JSON
46 lines
1.1 KiB
JSON
{
|
|
"name": "uomysticmoon-server",
|
|
"version": "1.0.0",
|
|
"description": "REST API for the UOMysticmoon website and admin panel",
|
|
"main": "src/server.js",
|
|
"scripts": {
|
|
"start": "node src/server.js",
|
|
"dev": "nodemon src/server.js",
|
|
"seed": "node db/seed.js",
|
|
"swagger": "node swagger/swagger.js",
|
|
"test": "node --test"
|
|
},
|
|
"keywords": [
|
|
"express",
|
|
"mariadb",
|
|
"jwt",
|
|
"bcrypt"
|
|
],
|
|
"author": "whitlocktech",
|
|
"license": "ISC",
|
|
"dependencies": {
|
|
"bcryptjs": "^2.4.3",
|
|
"cookie-parser": "^1.4.6",
|
|
"cors": "^2.8.5",
|
|
"dotenv": "^16.4.5",
|
|
"express": "^4.19.2",
|
|
"express-rate-limit": "^7.4.0",
|
|
"express-slow-down": "^3.1.0",
|
|
"express-validator": "^7.2.0",
|
|
"helmet": "^7.1.0",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"mariadb": "^3.3.1",
|
|
"morgan": "^1.10.0",
|
|
"multer": "^2.0.1",
|
|
"nodemailer": "^9.0.1",
|
|
"qrcode": "^1.5.4",
|
|
"sanitize-html": "^2.17.5",
|
|
"speakeasy": "^2.0.0",
|
|
"swagger-ui-express": "^5.0.1"
|
|
},
|
|
"devDependencies": {
|
|
"nodemon": "^3.1.4",
|
|
"swagger-autogen": "^2.23.7"
|
|
}
|
|
}
|