Open matthewdking opened 6 years ago
When you import the handlers you can actually destructure the functions. This means you don't have to do this...
handlers.homeHandler(req, res);
But can call the function immediately without repeating handlers.
handlers.
homeHandler(req, res);
When you import the handlers the code could look something like...
const { homeHandler, handlerLogin, handlerAddUser, handlerAddArticle, handlerPosts, notFoundHandler, } = require('./handler.js');
When you import the handlers you can actually destructure the functions. This means you don't have to do this...
But can call the function immediately without repeating
handlers.
When you import the handlers the code could look something like...