From bf82da84699a651eb86484f6ee1d88fd54020cf7 Mon Sep 17 00:00:00 2001 From: Aydan Pirani Date: Sun, 14 Apr 2024 18:05:46 -0500 Subject: [PATCH] more cors changes --- src/middleware/cors-middleware.ts | 4 ++-- src/services/subscription/subscription-router.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/middleware/cors-middleware.ts b/src/middleware/cors-middleware.ts index be5e39f..599548f 100644 --- a/src/middleware/cors-middleware.ts +++ b/src/middleware/cors-middleware.ts @@ -1,4 +1,4 @@ -import cors from "cors"; +// import cors from "cors"; // // Allow CORS for Netlify deploy previews // const allowedOrigins = ["https://reflectionsprojections.org"]; @@ -22,4 +22,4 @@ import cors from "cors"; // }, // }); -export default cors(); +// export default cors(); diff --git a/src/services/subscription/subscription-router.ts b/src/services/subscription/subscription-router.ts index 50555bf..93523ef 100644 --- a/src/services/subscription/subscription-router.ts +++ b/src/services/subscription/subscription-router.ts @@ -2,12 +2,13 @@ import { Router } from "express"; import { StatusCodes } from "http-status-codes"; import { SubscriptionValidator } from "./subscription-schema"; import { Database } from "../../database"; -import corsMiddleware from "../../middleware/cors-middleware"; +// import corsMiddleware from "../../middleware/cors-middleware"; +import cors from "cors"; const subscriptionRouter = Router(); // Create a new subscription -subscriptionRouter.post("/", corsMiddleware, async (req, res, next) => { +subscriptionRouter.post("/", cors(), async (req, res, next) => { try { // Validate the incoming user subscription const subscriptionData = SubscriptionValidator.parse(req.body);