This is a great way to improve the readability of your node application; move all routes into separate modules and export.
Put the following in a file called home.js:
Put the following in a file called login.js:
Add both to a folder called routes.
From your application file:
This post is part of a series of posts tagged under node-plates a boilerplate mobile/web application written in node.js, express, socket.io, mongooose, jquery.mobile & html 5.
You can grab this from github ->