-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved routes index.js code with better documentation
- Loading branch information
Showing
1 changed file
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |