I have a get request handler of a Router in Node.js and it has a lot of code:
const express = require("express");
const router = express.Router();
router.get("/api/employees/employee-response", async (req, res) => {
try {
// First action with code
// Second action with code
// Third action with code
}
catch(exp) {
// ...
}
module.exports = router;
How can I split that into small functions and call those functions from the Router?