diff --git a/functions/package.json b/functions/package.json index ef25854a..49b864ad 100644 --- a/functions/package.json +++ b/functions/package.json @@ -16,7 +16,7 @@ "playground": "node lib/playground.js" }, "engines": { - "node": "18" + "node": "20" }, "main": "lib/index.js", "dependencies": { diff --git a/functions/src/prerender/controller.ts b/functions/src/prerender/controller.ts index b294c463..126d4dcb 100644 --- a/functions/src/prerender/controller.ts +++ b/functions/src/prerender/controller.ts @@ -1,6 +1,6 @@ import * as express from 'express'; -import * as functions from 'firebase-functions'; import {errorMiddleware} from '../middlewares/error.middleware'; +import {onRequest} from 'firebase-functions/v2/https'; export function prerenderOpenSearch(req: express.Request, res: express.Response) { // TODO support language selection - opensearch.xml?lang=he @@ -23,5 +23,5 @@ export const prerenderFunctions = () => { const app = express(); app.get('/opensearch.xml', prerenderOpenSearch); app.use(errorMiddleware); - return functions.https.onRequest(app); + return onRequest({cors: true, invoker: 'public'}, app); };