Skip to content

app.use(require('./controllers')) doesn't work #2

@JLGouwy

Description

@JLGouwy

Hi,

i decided to learn node/express JS. And i want to begin with a good start, a good structure directly. And yours seems really fine.

I'm trying to adapt mine to yours, but i've few questions.

When I put this line "app.use(require('./controllers'))", the console said me "controller module doesn't exist" !
How does it work this middleware ?
if i understand, when you write this line, you "include" all controller file, right ?

Until now, i learned that all modules have to localize to node_modules folder. So, i suppose that the middleware tried to find controller.js in this folder.

Can you enlighten me ?

Thanks to share your knowledge,
Appreciate.

JL, from Belgium.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions