feat(cors): using cors config
This commit is contained in:
@@ -4,6 +4,7 @@ import { config } from "dotenv";
|
|||||||
|
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import { resolve } from "path";
|
import { resolve } from "path";
|
||||||
|
import corsConfig from "./config/cors";
|
||||||
import { ratelimit } from "./config/ratelimit";
|
import { ratelimit } from "./config/ratelimit";
|
||||||
import errorHandler from "./config/errorHandler";
|
import errorHandler from "./config/errorHandler";
|
||||||
import notFoundHandler from "./config/notFoundHandler";
|
import notFoundHandler from "./config/notFoundHandler";
|
||||||
@@ -15,6 +16,7 @@ const app: express.Application = express();
|
|||||||
const PORT: number = Number(process.env.PORT) || 4000;
|
const PORT: number = Number(process.env.PORT) || 4000;
|
||||||
|
|
||||||
app.use(morgan("dev"));
|
app.use(morgan("dev"));
|
||||||
|
app.use(corsConfig);
|
||||||
app.use(ratelimit);
|
app.use(ratelimit);
|
||||||
|
|
||||||
app.use(express.static(resolve(__dirname, "..", "public")));
|
app.use(express.static(resolve(__dirname, "..", "public")));
|
||||||
|
|||||||
Reference in New Issue
Block a user