No error handling or cors handling in gcf.
-
Install cute-gcf locally.
npm install cute-gcf
import { protect } from "cute-gcf";
const main = async (req, res) =>
{
// errors get caught and printed
// INTERNAL SERVER ERROR CODE RESPONSE AUTOMATIC
// dotenv.config(); automated by protect
// no error handling in code
res.sendStatus(OK);
};
export const yourGoogleCloudFunction = protect(main);