I want to deploy a remix application to Firebase Cloud Functions, using Hosting for the static assets. The function is defined as:
const functions = require("firebase-functions");
const express = require("express");
const compression = require("compression");
const morgan = require("morgan");
const { createRequestHandler } = require("@remix-run/express");
const app = express();
app.use(compression());
app.use(morgan("tiny"));
app.all("*", createRequestHandler({ build: require("./build") }));
const api = functions.https.onRequest(app);
module.exports = {
api,
};
As documented here the request bodies are parsed by firebase before the request is passed to the api
function. But the app is expecting "untouched" requests. This results in the request body being empty inside remix.
Is there a way to disable or undo the request body parsing? I've tried req.body = req.rawBody;
in a middleware without luck.