Skip to content

Commit

Permalink
more cors changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AydanPirani committed Apr 14, 2024
1 parent 4cb44a0 commit bf82da8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/middleware/cors-middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cors from "cors";
// import cors from "cors";

// // Allow CORS for Netlify deploy previews
// const allowedOrigins = ["https://reflectionsprojections.org"];
Expand All @@ -22,4 +22,4 @@ import cors from "cors";
// },
// });

export default cors();
// export default cors();
5 changes: 3 additions & 2 deletions src/services/subscription/subscription-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bf82da8

Please sign in to comment.