Skip to content

Commit

Permalink
feat: setup swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Aug 27, 2024
1 parent dd1b2e1 commit 2f21410
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 7 deletions.
217 changes: 211 additions & 6 deletions package-lock.json

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

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"showdown": "^2.1.0",
"stripe": "^16.8.0"
"stripe": "^16.8.0",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1"
},
"devDependencies": {
"@types/base-64": "^1.0.0",
Expand All @@ -82,6 +84,8 @@
"@types/react": "^18.2.43",
"@types/react-dom": "18.3.0",
"@types/showdown": "^2.0.6",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.6",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.15.0",
"eslint": "^8.53.0",
Expand Down
14 changes: 14 additions & 0 deletions src/routes/VersionRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ const VersionRouter = () => {
const controller = new VersionController(new VersionService());
const router = express.Router();

/**
* @openapi
* /api/version:
* get:
* description: Get the version of the API
* responses:
* '200':
* description: A successful response
* content:
* application/text:
* schema:
* type: string
* example: "Notion to Anki v1.0.0"
*/
router.get('/api/version', (req, res) => controller.getVersionInfo(req, res));

return router;
Expand Down
Loading

0 comments on commit 2f21410

Please sign in to comment.