I have an express app running on firebase, I want it to have the minInstances:1
config
Currently I Use:
import {onRequest} from "firebase-functions/v2/http
export const xx = onRequest(app);
Only examples I can find are for individual functions:
functions.runWith({ minInstances: minInstancesConfig}).https....
how can I wrap the onRequest(app)
with the minInstances config?
*Also I saw a suggestion about using the Cloud Scheduler for short intervals, I tried it and it just drives the server crazy:
2
Answers
This seems to do the job:
It’s the same as the example using req and res in the documentaion. Just give your app instead of the function callback.
The addition of
runWith
in the chain of calls here doesn’t change the wayonRequest
receives parameters. It just changes the way to resulting container behaves under load.