How to include route handlers in multiple files in Express? [duplicate]

In my NodeJS express application I have app.js that has a few common routes. Then in a wf.js file I would like to define a few more routes.

How can I get app.js to recognize other route handlers defined in wf.js file?

A simple require does not seem to work.

13 Answers
13

Leave a Comment