Reading template files and connecting to mongodb on each node.js request

91 views Asked by At

I'm new to node js and I've seen on tutorials how the programmer creates a connection to mongodb and reads in html templates from disk each time a request is made to the server, ie the code resides in the request event handler.

This can't possibly be the way it should be done right? The template file should be buffered into memory and the database connection should created on the startup of the server?

0

There are 0 answers