diff --git a/app/server/app/routes/formioNCES.js b/app/server/app/routes/formioNCES.js index 5ffb4da0..74c0f8c2 100644 --- a/app/server/app/routes/formioNCES.js +++ b/app/server/app/routes/formioNCES.js @@ -12,23 +12,8 @@ const { FORMIO_NCES_API_KEY } = process.env; const router = express.Router(); -/** - * Enable CORS for local development - * - * @param {express.Request} req - * @param {express.Response} res - * @param {express.NextFunction} next - */ -function enableLocalhostCORS(req, res, next) { - if (req.get("host") === "localhost:3001") { - cors({ origin: "*" }); - } - - next(); -} - // --- Search the NCES data with the provided NCES ID and return a match -router.get("/:searchText?", enableLocalhostCORS, (req, res) => { +router.get("/:searchText?", cors({ origin: "*" }), (req, res) => { const { searchText } = req.params; const apiKey = req.headers["x-api-key"];