Listing 3.3. Setting up the homepage controller in app_server/controllers/main.js
That’s all there is to creating the controller export. The next step is to require this controller module in the routes file so that we can use the exposed method in the route definition. The following listing shows how the main routes file index.js should now look.