Skip to content

Commit 20da01e

Browse files
committed
feat: frontend url changed
1 parent ab9986e commit 20da01e

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

auth-service/package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auth-service/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"devDependencies": {
3232
"@types/bcrypt": "^5.0.2",
3333
"@types/cookie-parser": "^1.4.8",
34+
"@types/cors": "^2.8.17",
3435
"@types/dotenv": "^8.2.3",
3536
"@types/express": "^5.0.0",
3637
"@types/jsonwebtoken": "^9.0.7",

auth-service/src/presentation/server.ts

Lines changed: 9 additions & 1 deletion
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-
13+
import cors from "cors";
1414
const app:Application = express();
1515

1616
app.use(express.json())
@@ -21,6 +21,14 @@ if(process.env.NODE_ENV === "development"){
2121
app.use(morgan("dev"))
2222
}
2323

24+
app.use(cors({
25+
origin: 'https://v-learning-client-5r8j.vercel.app',
26+
credentials: true,
27+
allowedHeaders: ['Range', 'Authorization', 'Content-Type','Accept'],
28+
exposedHeaders: ['Content-Disposition','Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type'],
29+
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
30+
}));
31+
2432
app.use('/',routes(dependencies));
2533

2634
app.use('*',(req:Request,res:Response)=>{

course-srv/src/presentation/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ app.use(express.urlencoded({extended:true}));
2121
app.use(cookieParser());
2222
// app.use(bodyParser.text({type: '/'}));
2323
app.use(cors({
24-
origin: 'https://welearning.online',
24+
origin: 'https://v-learning-client-5r8j.vercel.app',
2525
credentials: true,
2626
allowedHeaders: ['Range', 'Authorization', 'Content-Type','Accept'],
2727
exposedHeaders: ['Content-Disposition','Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type'],

0 commit comments

Comments
 (0)