From ad3c718e9009ec7496479793c12b897d700ec620 Mon Sep 17 00:00:00 2001 From: yunji0387 Date: Fri, 23 Feb 2024 13:04:24 -0600 Subject: [PATCH] Add cors middleware to server.js --- server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 8e54b08..7d685d2 100644 --- a/server.js +++ b/server.js @@ -1,6 +1,7 @@ const express = require('express'); const app = express(); const mongoose = require('mongoose'); +const cors = require('cors'); require('dotenv').config(); @@ -12,7 +13,7 @@ mongoose.connect(process.env.MONGO_URI) // Middleware to parse JSON bodies app.use(express.json()); -app.use(cors()) +app.use(cors()); // Import the standing routes const standingRoutes = require('./routes/standingRoutes'); // Adjust the path as necessary