Skip navigation

Modularizing our routes

Modularizing our routes: Building a Website with Node.js and Express.js
Modularizing our routes: Building a Website with Node.js and Express.js

In a large application, It's not practical to have all your routes in a single file. NodeJS make making modules easy with built in methods that makes it easy to import and output content. The require statement let's you import one document into another one and module.exports allows you to export the contents of a module. Within express, the use method allows our application to use external routes as part of the application. In order for external routes to work, we'll need to a router object provided by the express library to create an instance of a route. This makes the route mountable by our original application.

Resume Transcript Auto-Scroll
Skill Level Intermediate
3h 16m
Duration
83,838
Views
Show More Show Less
Skills covered in this course
Developer Web Web Development Express.js Node.js

Continue Assessment

You started this assessment previously and didn't complete it. You can pick up where you left off, or start over.

Start Your Free Trial Now

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now