Updated firebase function example

This commit is contained in:
Alexander Cerutti
2025-01-11 15:56:51 +01:00
parent 8c8763f8cd
commit aae3ad5982
3 changed files with 1098 additions and 967 deletions

View File

@@ -1,7 +1,7 @@
import * as functions from "firebase-functions";
import * as functions from "firebase-functions/https";
import { initializeApp } from "firebase-admin/app";
import { getStorage } from "firebase-admin/storage";
import passkit from "passkit-generator";
import { PKPass } from "passkit-generator";
import type { Barcode, TransitType } from "passkit-generator";
import fs from "node:fs";
import path from "node:path";
@@ -12,8 +12,6 @@ import os from "node:os";
// Should probably not be used in production
import startData from "./startData.json" assert { type: "json" };
const PKPass = passkit.PKPass;
interface RequestWithBody extends functions.Request {
body: {
passModel: string;
@@ -68,7 +66,7 @@ initializeApp({
const storageRef = getStorage().bucket();
export const pass = functions.https.onRequest(
export const pass = functions.onRequest(
async (request: RequestWithBody, response) => {
let modelBasePath: string;