Skip to content

Commit

Permalink
Improved routes index.js code with better documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrea committed Dec 27, 2023
1 parent 951d08e commit f348b0d
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/routes/v4/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
// routes/index.js
import { Router } from 'express';
import factRoutes from './textUtilities/facts.js';
import factRoutes from './textUtilities/fact.js';

/**
* Express Router for handling API routes.
* @type {Router}
* @namespace routes
*/
const router = Router();

/**
* GET v1/docs
* @api {use} v1/fact Use Fact Routes
* @apiDescription Mount the fact-related routes for handling text utilities.
* @apiName UseFactRoutes
* @apiGroup Routes
*
* @apiSuccess {Object} routes Fact-related routes mounted on the parent router.
*
* @function createFactRoutes
* @description Creates and returns a set of routes for handling text utilities related to facts.
* @returns {Object} Fact-related routes.
*/

router.use('/fact', factRoutes);

/**
* Exporting the router for use in other parts of the application.
* @exports {Router} router - Express Router instance with mounted routes.
*/
export default router;

0 comments on commit f348b0d

Please sign in to comment.