diff --git a/components/home/home.controller.js b/components/home/home.controller.js index 5d5698f..2727d31 100644 --- a/components/home/home.controller.js +++ b/components/home/home.controller.js @@ -1,5 +1,5 @@ class HomeController { - getHome = async (_, res) => { + async getHome(_, res) { try { return res.status(200).send('Welcome to the Pullit API'); } catch (error) { @@ -10,11 +10,10 @@ class HomeController { 'stack': error.stack }); } else { - return res.status(500).json({error: 'Internal Server Error'}); + return res.status(500).json({ error: 'Internal Server Error' }); } } - }; - + } } -export default HomeController; +module.exports = HomeController; diff --git a/components/home/home.module.js b/components/home/home.module.js index 1e3b52b..48ea844 100644 --- a/components/home/home.module.js +++ b/components/home/home.module.js @@ -4,7 +4,6 @@ const HomeRouter = require('./home.router'); const homeController = new HomeController(); const homeRouter = new HomeRouter(homeController); -export default { +module.exports = { router: homeRouter.router, }; - diff --git a/components/home/home.router.js b/components/home/home.router.js index d49e6f1..14ed83a 100644 --- a/components/home/home.router.js +++ b/components/home/home.router.js @@ -7,10 +7,10 @@ class HomeRouter { get router() { const router = express.Router(); - router.route('/').get(this.homeController.getHome); + router.route('/').get(this.homeController.getHome.bind(this.homeController)); return router; } } -export default HomeRouter; +module.exports = HomeRouter;