Skip to content

Commit

Permalink
fix: handle route
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherDev committed Jun 26, 2024
1 parent 282818c commit f6376ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/api/src/routes/v2/protocol/circulatingSupply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { cache } from '../../../middlewares/cache-redis';
import { cacheIntervals } from '../../../utils/api';
import { circulatingSupply } from '~controllers/v2/circulatingSupply';

export default (app: Router): void => {
export default (route: Router): void => {
/**
* @swagger
*
* /circulating-supply:
* /protocol/circulating-supply:
* get:
* tags:
* - "generic"
Expand All @@ -17,12 +17,12 @@ export default (app: Router): void => {
* "200":
* description: OK
*/
app.get('/circulating-supply', cache(cacheIntervals.oneDay), circulatingSupply);
route.get('/circulating-supply', cache(cacheIntervals.oneDay), circulatingSupply);

/**
* @swagger
*
* /total-supply:
* /protocol/total-supply:
* get:
* tags:
* - "generic"
Expand All @@ -40,5 +40,5 @@ export default (app: Router): void => {
* data:
* type: number
*/
app.get('/total-supply', (_req: Request, res: Response) => res.send(100_000_000_000));
route.get('/total-supply', (_req: Request, res: Response) => res.send(100_000_000_000));
};
3 changes: 3 additions & 0 deletions packages/api/src/routes/v2/protocol/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Router } from 'express';

import microcredit from './microcredit';
import circulatingSupply from './circulatingSupply';

export default (app: Router): void => {
const route = Router();
app.use('/protocol', route);

microcredit(route);
circulatingSupply(route);

};

0 comments on commit f6376ef

Please sign in to comment.