I made individual routes for each grouping of endpoints when it seemed to make sense. This modularized the code, making it easier to find particular elements and/or behavior. In addition, I removed the multiple calls via express.static for static files throughout the server, this increases rendering speed noticeably. I also removed staticRoot variable as it's no longer needed. Also changed the setting of the port, to a get/set relationship as it's best practice and relies on process.env.PORT (in production) directly rather than the config object.
I made individual routes for each grouping of endpoints when it seemed to make sense. This modularized the code, making it easier to find particular elements and/or behavior. In addition, I removed the multiple calls via express.static for static files throughout the server, this increases rendering speed noticeably. I also removed staticRoot variable as it's no longer needed. Also changed the setting of the port, to a get/set relationship as it's best practice and relies on process.env.PORT (in production) directly rather than the config object.