mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 16:22:59 +10:00
add CORS to server, input appUrl
This commit is contained in:
3
.gitpod.Dockerfile
vendored
3
.gitpod.Dockerfile
vendored
@ -1,3 +0,0 @@
|
|||||||
FROM gitpod/workspace-postgresql
|
|
||||||
|
|
||||||
RUN pg_start
|
|
||||||
11
.gitpod.yml
11
.gitpod.yml
@ -1,8 +1,8 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: Run a local PostgreSQL Database
|
- name: Run PostgreSQL Database
|
||||||
command: docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
|
command: docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
|
||||||
|
|
||||||
- name: Restore .env file, or create a new one
|
- name: Restore Environment Variables
|
||||||
command: |
|
command: |
|
||||||
if [ -f .env ]; then
|
if [ -f .env ]; then
|
||||||
echo "Found .env in workspace"
|
echo "Found .env in workspace"
|
||||||
@ -16,9 +16,10 @@ tasks:
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set up dependencies, and run the development server
|
- name: Install Project Dependencies
|
||||||
init: pnpm install
|
command: |
|
||||||
command: pnpm dev
|
npx playwright install-deps
|
||||||
|
pnpm install
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
# PostgreSQL
|
# PostgreSQL
|
||||||
|
|||||||
1
scripts/generate-env.ts
Normal file
1
scripts/generate-env.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
console.log('Hello, World!');
|
||||||
@ -10,8 +10,10 @@ const bootstrap = async () => {
|
|||||||
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
||||||
const configService = app.get(ConfigService);
|
const configService = app.get(ConfigService);
|
||||||
|
|
||||||
|
const appUrl = configService.get<string>('app.url');
|
||||||
|
|
||||||
// Middleware
|
// Middleware
|
||||||
app.enableCors({ credentials: true });
|
app.enableCors({ origin: [appUrl], credentials: true });
|
||||||
app.enableShutdownHooks();
|
app.enableShutdownHooks();
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user