11import express , { Application } from "express" ;
2- import * as functions from "firebase-functions" ;
2+ // import * as functions from "firebase-functions";
33import cors from "cors" ;
44import bodyParser from "body-parser" ;
55import router from "./routes" ;
66import { generateAPIError } from "~middlewares/errors" ;
7- import APIError from "~utils/APIError" ;
8- import { HTTP_FORBIDDEN } from "~utils/http_code" ;
7+ // import APIError from "~utils/APIError";
8+ // import { HTTP_FORBIDDEN } from "~utils/http_code";
99// import APIError from "~utils/APIError";
1010// import { HTTP_FORBIDDEN } from "~utils/http_code";
1111
1212// Express configuration
1313const app : Application = express ( ) ;
1414
15- const config = functions . config ( ) ;
15+ /* const config = functions.config();
1616const env = config.ecosystem.env;
1717
1818const whitelist = ["https://portfolio-panel.octalogic.in"];
@@ -24,10 +24,12 @@ const corsOptions = {
2424 callback(new APIError("Not allowed by CORS", null, HTTP_FORBIDDEN), false);
2525 }
2626 },
27- } ;
27+ }; */
2828
2929// Automatically allow cross-origin requests
30- app . use ( cors ( env === "prod" ? corsOptions : { origin : true } ) ) ;
30+ // TODO:
31+ // app.use(cors(env === "prod" ? corsOptions : { origin: true }));
32+ app . use ( cors ( { origin : true } ) ) ;
3133app . use ( bodyParser . urlencoded ( { extended : true } ) ) ;
3234app . use ( bodyParser . json ( ) ) ;
3335
0 commit comments