Nodejs Express separate routes

Move the rout definition from the index.js or app.js

Folder structure

node structure

index.js file

 

routes.js

you can add more routs like admin routs (*i am not added this in my project so it will not see int the above folder structure)

adminroutes.js

 

ref: https://expressjs.com/en/guide/routing.html

3 Likes
Author: bm on August 2, 2016
Category: Express, NodeJs
Tags: , ,

Your comment:

Your Name

Comment:




Last articles