Skip to content

Commit ea2edf4

Browse files
committed
fix: dist location for key script and remove demo mode logic
1 parent 1ee5567 commit ea2edf4

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/app.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ const corsOptions: CorsOptions = {
4545
return callback(null, true);
4646
}
4747

48-
if (process.env.DEMO === 'true') {
49-
// Local development mode
50-
if (origin === 'http://localhost:5001' || origin === 'http://localhost:3000') {
51-
return callback(null, true);
52-
}
53-
}
54-
5548
if (origin === allowedOrigin) {
5649
return callback(null, true);
5750
}

validateEnvs.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ for var in $required_vars; do
1111
done
1212

1313
echo "Generating JWKS keys"
14-
npx tsx ./src/scripts/initKeys.ts
14+
if [ "${NODE_ENV:-development}" = "production" ]; then
15+
echo "Running in production mode"
16+
npx tsx ./dist/scripts/initKeys.ts
17+
else
18+
echo "Running in development mode"
19+
npx tsx ./src/scripts/initKeys.ts
20+
fi
1521
echo "JWKS keys ready"
1622

1723
if ! PGPASSWORD=$DB_PASSWORD psql -h "$DB_HOST" -U "$DB_USER" -p "$DB_PORT" -lqt | cut -d \| -f 1 | grep -qw "$DB_NAME"; then

0 commit comments

Comments
 (0)