Skip to content

Can destructure the handlers when you import #40

Description

@matthewdking

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.

homeHandler(req, res);

When you import the handlers the code could look something like...

const {
  homeHandler,
  handlerLogin,
  handlerAddUser,
  handlerAddArticle,
  handlerPosts,
  notFoundHandler,
} = require('./handler.js');

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions