2 ms·
This highlights the fact that nobody has created a good appserver for node yet. There is such a focus on web frameworks still that everyone keeps writing this c
by latchkey 14y ago
This highlights the fact that nobody has created a good appserver for node yet. There is such a focus on web frameworks still that everyone keeps writing this code over and over again for their own apps. In my case, I wrote more of a 'service' layer with a set of lifecycle events because mongo generally isn't the only service that needs a connection. We have redis, neo4j, apns, etc. I then just 'require' my service wherever I need it in my application and have access to its connection. Services can also have dependencies on other services, such as a ram based caching layer that depends on pulling data from mongo.