Currently I have the following Code and so much more Calls inside the File api.js, but now the file is so huge that it isn't easy to find anything anymore so I wanna outsource different routes in different files like api_admin.js, api_user.js, api_general.js, is it possible to outsource different calls to different files and include them?
app.use( '/assets', express.static( __dirname + '/public/assets' ) );
// Serve index.html
app.get( '/', function( req, res ) {
// ...
} );
// Serve Partials
app.get( '/views/:name', function( req, res ) {
// ...
} );
app.get( '/views/user/:name', function( req, res ) {
// ...
} );
app.get( '/views/admin/:name', function( req, res ) {
// ...
} );
// Serve Data
var router = express.Router();
app.use( '/v1', router );
router.post( '/user/get/info', function( req, res ) {
// ...
} );
router.post( '/admin/user/list', function( req, res ) {
// ...
} );
router.post( '/admin/apps/list', function( req, res ) {
// ...
} );