Skip to content

Commit

Permalink
feat: init Swagger docs (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeaturner authored Sep 10, 2024
1 parent 0d6428d commit 6e592d1
Show file tree
Hide file tree
Showing 4 changed files with 1,310 additions and 24 deletions.
84 changes: 60 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@fortawesome/free-solid-svg-icons": "^6.2.1",
"@fortawesome/vue-fontawesome": "^3.0.2",
"@hapi/boom": "^10.0.0",
"@types/swagger-ui-express": "^4.1.6",
"@vitejs/plugin-vue": "^3.0.3",
"@vue/compiler-sfc": "^3.2.33",
"@vue/server-renderer": "^3.2.33",
Expand Down Expand Up @@ -55,6 +56,7 @@
"sequelize-typescript": "^2.1.6",
"sharp": "^0.32.6",
"sirv": "^2.0.2",
"swagger-ui-express": "^5.0.1",
"tsx": "^3.12.6",
"typescript": "^4.6.4",
"uuid": "^9.0.0",
Expand Down
3 changes: 3 additions & 0 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import type { PageContextInitCustom } from '@renderer/types';
import { AuthController } from './controllers/AuthController';
import { UserController } from './controllers/UserController';
import { getProductionURL } from './helpers';
import swaggerUi from 'swagger-ui-express';
import swaggerSpec from './swagger/swagger.json'

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand All @@ -28,6 +30,7 @@ app.use(helmet.hidePoweredBy()); // TODO: Improve helmet utilization
app.use(compression());
app.use(bodyParser.json());
app.use(cookieParser());
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec, { explorer: true }));

app.use('/api/v1', APIRouter);

Expand Down
Loading

0 comments on commit 6e592d1

Please sign in to comment.