Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed cors from express #43

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const express = require('express');
const cors = require('cors');
const dotenv =require('dotenv');
const indexRoutes = require("./routes/indexRoutes");
const mailRoutes = require("./routes/mailRoutes");
Expand All @@ -9,14 +8,7 @@ dotenv.config({
path: './.env'
})
const app = express();

// Configure CORS options
const corsOptions = {
origin: ['http://localhost:3000', 'https://nr-results-exam-test-frontend.apps.silver.devops.gov.bc.ca/'],
methods: ['GET','POST'], // Specify the allowed HTTP methods
};
app.use(express.json());
app.use(cors(corsOptions));

app.use('/api/', indexRoutes);
app.use('/api/mail', mailRoutes);
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ version: '3.9'
x-common: &common
depends_on: ["backend"]
environment:
VITE_AWS_DOMAIN: prod-fam-user-pool-domain.auth.ca-central-1.amazoncognito.com
VITE_BACKEND_URL: http://backend:5000
VITE_CHES_FROM_EMAIL : [email protected]
VITE_CHES_ADMIN_EMAIL : [email protected]
Expand Down
2 changes: 1 addition & 1 deletion frontend/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

handle /env.js {
header Content-Type "text/javascript"
respond `window.config = {"VITE_USER_POOLS_ID":"{$VITE_USER_POOLS_ID}","VITE_USER_POOLS_WEB_CLIENT_ID":"{$VITE_USER_POOLS_WEB_CLIENT_ID}","VITE_REDIRECT_SIGN_OUT":"{$VITE_REDIRECT_SIGN_OUT}","VITE_ZONE":"{$VITE_ZONE}","VITE_CHES_FROM_EMAIL":"{$VITE_CHES_FROM_EMAIL}","VITE_CHES_ADMIN_EMAIL":"{$VITE_CHES_ADMIN_EMAIL}","VITE_BACKEND_URL":"{$VITE_BACKEND_URL}"};`
respond `window.config = {"VITE_AWS_DOMAIN":"{$VITE_AWS_DOMAIN}","VITE_USER_POOLS_ID":"{$VITE_USER_POOLS_ID}","VITE_USER_POOLS_WEB_CLIENT_ID":"{$VITE_USER_POOLS_WEB_CLIENT_ID}","VITE_REDIRECT_SIGN_OUT":"{$VITE_REDIRECT_SIGN_OUT}","VITE_ZONE":"{$VITE_ZONE}","VITE_CHES_FROM_EMAIL":"{$VITE_CHES_FROM_EMAIL}","VITE_CHES_ADMIN_EMAIL":"{$VITE_CHES_ADMIN_EMAIL}","VITE_BACKEND_URL":"{$VITE_BACKEND_URL}"};`
}

handle_path /* {
Expand Down
2 changes: 1 addition & 1 deletion frontend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ parameters:
- name: VITE_ZONE
value: DEV
- name: VITE_AWS_DOMAIN
value: "test-fam-user-pool-domain.auth.ca-central-1.amazoncognito.com"
value: "prod-fam-user-pool-domain.auth.ca-central-1.amazoncognito.com"
- name: VITE_CHES_FROM_EMAIL
value: "[email protected]"
- name: VITE_CHES_ADMIN_EMAIL
Expand Down
Loading