Skip to content

Commit ba7fc9a

Browse files
committed
romoved cors config from services
1 parent c7bc60e commit ba7fc9a

4 files changed

Lines changed: 37 additions & 37 deletions

File tree

auth-service/src/presentation/server.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { dependencies } from "../__boot/dependencies";
1010
import { routes } from "../infrastructure/routes";
1111
import { errorHandler } from "../_lib/common/error";
1212
// import { multerError } from "../_lib/common/error/multerError";
13-
import cors from "cors";
13+
// import cors from "cors";
1414
const app:Application = express();
1515

1616
app.use(express.json())
@@ -30,13 +30,13 @@ if(process.env.NODE_ENV === "development"){
3030
// }));
3131

3232

33-
app.use(cors({
34-
origin: 'https://v-learning-client-5r8j.vercel.app',
35-
methods: ["GET", "POST", "HEAD", "PUT", "PATCH", "DELETE", "OPTIONS"],
36-
credentials: true,
37-
allowedHeaders: ['Content-Type', 'Authorization', 'Cookie', 'Range', 'Accept'],
38-
exposedHeaders: ['Content-Disposition', 'Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type']
39-
}));
33+
// app.use(cors({
34+
// origin: 'https://v-learning-client-5r8j.vercel.app',
35+
// methods: ["GET", "POST", "HEAD", "PUT", "PATCH", "DELETE", "OPTIONS"],
36+
// credentials: true,
37+
// allowedHeaders: ['Content-Type', 'Authorization', 'Cookie', 'Range', 'Accept'],
38+
// exposedHeaders: ['Content-Disposition', 'Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type']
39+
// }));
4040

4141
app.use('/',routes(dependencies));
4242

chat-service/src/presentation/server.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { dependencies } from "../__boot/dependencies";
88
import { createServer } from "http";
99
import connectSokcetIo from "../infrastructure/socket/connection";
1010
import { SocketService } from "../infrastructure/socket/SocketService";
11-
import cors from 'cors';
11+
// import cors from 'cors';
1212
import { errorHandler } from "../_lib/error";
1313

1414
dotenv.config();
@@ -29,13 +29,13 @@ const allowedOrigins = process.env.CLIENT_URL;
2929

3030
// app.use(cors(corsOptions));
3131

32-
app.use(cors({
33-
origin:allowedOrigins,
34-
credentials: true,
35-
allowedHeaders: ['Authorization', 'Content-Type', 'Range', 'Accept'],
36-
exposedHeaders: ['Content-Disposition', 'Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type'],
37-
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
38-
}));
32+
// app.use(cors({
33+
// origin:allowedOrigins,
34+
// credentials: true,
35+
// allowedHeaders: ['Authorization', 'Content-Type', 'Range', 'Accept'],
36+
// exposedHeaders: ['Content-Disposition', 'Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type'],
37+
// methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
38+
// }));
3939

4040

4141
const server = createServer(app);

course-srv/src/presentation/server.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import express, { Application, Request, Response } from "express";
22
import cookieParser from "cookie-parser";
33
import { config } from 'dotenv';
4-
import bodyParser from "body-parser";
5-
import helmet from 'helmet';
4+
// import bodyParser from "body-parser";
5+
// import helmet from 'helmet';
66

77

88
config();
99

1010
import { errorHandler } from "../_lib/error";
1111
import {routes} from "../infrastructure/routes";
1212
import { dependencies } from "../__boot/dependencies";
13-
import cors from 'cors';
13+
// import cors from 'cors';
1414

1515

1616
const app: Application = express();
@@ -31,19 +31,19 @@ app.use(cookieParser());
3131
// }));
3232

3333

34-
app.use(cors({
35-
origin: 'https://v-learning-client-5r8j.vercel.app',
36-
credentials: true,
37-
allowedHeaders: ['Authorization', 'Content-Type', 'Range', 'Accept'],
38-
exposedHeaders: ['Content-Disposition', 'Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type'],
39-
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
40-
}));
34+
// app.use(cors({
35+
// origin: 'https://v-learning-client-5r8j.vercel.app',
36+
// credentials: true,
37+
// allowedHeaders: ['Authorization', 'Content-Type', 'Range', 'Accept'],
38+
// exposedHeaders: ['Content-Disposition', 'Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type'],
39+
// methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
40+
// }));
4141

4242

4343
// Add helmet with CORP configuration
44-
app.use(helmet({
45-
crossOriginResourcePolicy: { policy: "cross-origin" }
46-
}));
44+
// app.use(helmet({
45+
// crossOriginResourcePolicy: { policy: "cross-origin" }
46+
// }));
4747

4848
app.get("/",(req:Request, res:Response) => {
4949
res.status(200).json({

notification-service/src/presentation/server.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import dotenv from "dotenv";
33
import cookieParser from "cookie-parser";
44
import { notificationRoutes } from '../infrastructure/routes';
55
import { dependencies } from '../__boot/dependencies';
6-
import cors from 'cors'
6+
// import cors from 'cors'
77

88
dotenv.config();
99

@@ -14,13 +14,13 @@ app.use(express.json());
1414
app.use(express.urlencoded({extended:true}));
1515
app.use(cookieParser());
1616

17-
app.use(cors({
18-
origin: 'https://v-learning-client-5r8j.vercel.app',
19-
credentials: true,
20-
allowedHeaders: ['Authorization', 'Content-Type', 'Range', 'Accept'],
21-
exposedHeaders: ['Content-Disposition', 'Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type'],
22-
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
23-
}));
17+
// app.use(cors({
18+
// origin: 'https://v-learning-client-5r8j.vercel.app',
19+
// credentials: true,
20+
// allowedHeaders: ['Authorization', 'Content-Type', 'Range', 'Accept'],
21+
// exposedHeaders: ['Content-Disposition', 'Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type'],
22+
// methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
23+
// }));
2424

2525

2626
app.get("/",(req:Request, res:Response) => {

0 commit comments

Comments
 (0)