While creating server.js file we need to provide routes information as var Login = require('./routes/login.js');app.use('/login', Login);Now, suppose the node project is a REST services project. so this type of entries could extend to lots of lines , meaning for every route we need to provide the above given 2 lines of code in server.js. Similarly, if there is lots of 'require' statements which are needed to start the server and if there is some code related to middle ware , routing mechanism, analytics mechanism etc. etc.How would it, then, be possible to keep the server.js file crisp(keeping it short and simple) and easy to understand?How and what design pattern I should follow to make server.js beautiful?
designing better and crisp server.js (the file which is called to start node application 'e.g. node server.js')
javascript;web development;node.js