Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

add CORS to server, input appUrl

Amruth Pillai2ba6658a0b17
diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile
deleted file mode 100644
index 9043f06ae..000000000
--- a/.gitpod.Dockerfile
+++ /dev/null
@@ -1,3 +0,0 @@
-FROM gitpod/workspace-postgresql
-
-RUN pg_start
\ No newline at end of file
diff --git a/.gitpod.yml b/.gitpod.yml
index d4fce2655..748c4b59b 100644
--- a/.gitpod.yml
+++ b/.gitpod.yml
@@ -1,8 +1,8 @@
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
- - name: Restore .env file, or create a new one
+ - name: Restore Environment Variables
command: |
if [ -f .env ]; then
echo "Found .env in workspace"
@@ -16,9 +16,10 @@ tasks:
fi
fi
- - name: Set up dependencies, and run the development server
- init: pnpm install
- command: pnpm dev
+ - name: Install Project Dependencies
+ command: |
+ npx playwright install-deps
+ pnpm install
ports:
# PostgreSQL
diff --git a/scripts/generate-env.ts b/scripts/generate-env.ts
new file mode 100644
index 000000000..eb065f93f
--- /dev/null
+++ b/scripts/generate-env.ts
@@ -0,0 +1 @@
+console.log('Hello, World!');
diff --git a/server/src/main.ts b/server/src/main.ts
index 7b91488cb..826d11fa4 100644
--- a/server/src/main.ts
+++ b/server/src/main.ts
@@ -10,8 +10,10 @@ const bootstrap = async () => {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
const configService = app.get(ConfigService);
+ const appUrl = configService.get<string>('app.url');
+
// Middleware
- app.enableCors({ credentials: true });
+ app.enableCors({ origin: [appUrl], credentials: true });
app.enableShutdownHooks();
app.use(cookieParser());