Skip to content

Commit

Permalink
fix(prerender): migrate to functions v2
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitMY committed Sep 14, 2024
1 parent 6812cb9 commit 7601eae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"playground": "node lib/playground.js"
},
"engines": {
"node": "18"
"node": "20"
},
"main": "lib/index.js",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions functions/src/prerender/controller.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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);
};

0 comments on commit 7601eae

Please sign in to comment.