Abdul Rehman
commited on
Commit
·
ed2136f
1
Parent(s):
13e29a4
vercel json fix
Browse files- .history/src/main_20240903214937.ts +23 -0
- .history/src/main_20240905002057.ts +24 -0
- .history/vercel_20240905002105.json +16 -0
- .history/vercel_20240905002203.json +16 -0
- src/main.ts +2 -1
- vercel.json +2 -2
.history/src/main_20240903214937.ts
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { NestFactory } from '@nestjs/core';
|
2 |
+
import { AppModule } from './app.module';
|
3 |
+
import * as bodyParser from 'body-parser';
|
4 |
+
import { ValidationPipe } from '@nestjs/common';
|
5 |
+
|
6 |
+
async function bootstrap() {
|
7 |
+
const app = await NestFactory.create(AppModule);
|
8 |
+
|
9 |
+
app.useGlobalPipes(new ValidationPipe());
|
10 |
+
|
11 |
+
// Enable CORS for all origins and all methods
|
12 |
+
app.enableCors({
|
13 |
+
origin: '*', // Allow all origins
|
14 |
+
methods: '*', // Allow all methods
|
15 |
+
credentials: true,
|
16 |
+
});
|
17 |
+
|
18 |
+
app.use(bodyParser.urlencoded({ extended: true }));
|
19 |
+
app.use(bodyParser.json());
|
20 |
+
|
21 |
+
await app.listen(8080);
|
22 |
+
}
|
23 |
+
bootstrap();
|
.history/src/main_20240905002057.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { NestFactory } from '@nestjs/core';
|
2 |
+
import { AppModule } from './app.module';
|
3 |
+
import * as bodyParser from 'body-parser';
|
4 |
+
import { ValidationPipe } from '@nestjs/common';
|
5 |
+
|
6 |
+
async function bootstrap() {
|
7 |
+
const app = await NestFactory.create(AppModule);
|
8 |
+
|
9 |
+
app.useGlobalPipes(new ValidationPipe());
|
10 |
+
|
11 |
+
// Enable CORS for all origins and all methods
|
12 |
+
app.enableCors({
|
13 |
+
// origin: '*', // Allow all origins
|
14 |
+
origin: ['https://property-fe-h8e2.vercel.app', 'http://localhost:3000'], // Replace with your frontend domain or use '*'
|
15 |
+
methods: '*', // Allow all methods
|
16 |
+
credentials: true,
|
17 |
+
});
|
18 |
+
|
19 |
+
app.use(bodyParser.urlencoded({ extended: true }));
|
20 |
+
app.use(bodyParser.json());
|
21 |
+
|
22 |
+
await app.listen(8080);
|
23 |
+
}
|
24 |
+
bootstrap();
|
.history/vercel_20240905002105.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 2,
|
3 |
+
"builds": [
|
4 |
+
{
|
5 |
+
"src": "dist/main.ts",
|
6 |
+
"use": "@vercel/node"
|
7 |
+
}
|
8 |
+
],
|
9 |
+
"routes": [
|
10 |
+
{
|
11 |
+
"src": "/(.*)",
|
12 |
+
"dest": "dist/main.ts",
|
13 |
+
"methods": ["GET", "POST", "PUT", "DELETE"]
|
14 |
+
}
|
15 |
+
]
|
16 |
+
}
|
.history/vercel_20240905002203.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 2,
|
3 |
+
"builds": [
|
4 |
+
{
|
5 |
+
"src": "dist/main.js",
|
6 |
+
"use": "@vercel/node"
|
7 |
+
}
|
8 |
+
],
|
9 |
+
"routes": [
|
10 |
+
{
|
11 |
+
"src": "/(.*)",
|
12 |
+
"dest": "dist/main.js",
|
13 |
+
"methods": ["GET", "POST", "PUT", "DELETE"]
|
14 |
+
}
|
15 |
+
]
|
16 |
+
}
|
src/main.ts
CHANGED
@@ -10,7 +10,8 @@ async function bootstrap() {
|
|
10 |
|
11 |
// Enable CORS for all origins and all methods
|
12 |
app.enableCors({
|
13 |
-
origin: '*', // Allow all origins
|
|
|
14 |
methods: '*', // Allow all methods
|
15 |
credentials: true,
|
16 |
});
|
|
|
10 |
|
11 |
// Enable CORS for all origins and all methods
|
12 |
app.enableCors({
|
13 |
+
// origin: '*', // Allow all origins
|
14 |
+
origin: ['https://property-fe-h8e2.vercel.app', 'http://localhost:3000'], // Replace with your frontend domain or use '*'
|
15 |
methods: '*', // Allow all methods
|
16 |
credentials: true,
|
17 |
});
|
vercel.json
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
"version": 2,
|
3 |
"builds": [
|
4 |
{
|
5 |
-
"src": "
|
6 |
"use": "@vercel/node"
|
7 |
}
|
8 |
],
|
9 |
"routes": [
|
10 |
{
|
11 |
"src": "/(.*)",
|
12 |
-
"dest": "
|
13 |
"methods": ["GET", "POST", "PUT", "DELETE"]
|
14 |
}
|
15 |
]
|
|
|
2 |
"version": 2,
|
3 |
"builds": [
|
4 |
{
|
5 |
+
"src": "dist/main.js",
|
6 |
"use": "@vercel/node"
|
7 |
}
|
8 |
],
|
9 |
"routes": [
|
10 |
{
|
11 |
"src": "/(.*)",
|
12 |
+
"dest": "dist/main.js",
|
13 |
"methods": ["GET", "POST", "PUT", "DELETE"]
|
14 |
}
|
15 |
]
|