After delving into tutorials on Firebase Cloud Functions, it's clear that Express is the go-to tool. However, I'm curious if it would be beneficial to set up a separate Express app for each function, with each mini-app containing only one route. Alternatively, should I create one function that is an Express app managing all request handlers?
The first approach offers the convenience of viewing separate logs for each function in the console.
On the other hand, the second approach allows for dynamic URLs and parameter matching, such as "user/1234/cars" (even though I don't plan to do so).
I'm particularly interested in which option is more resource-efficient or faster. How often are these function environments recreated?
If each function call uses a separate environment, then the first approach might be better due to the smaller app footprint. If this is not the case, then the latter approach could be superior.