This commit is contained in:
Will Freeman
2026-02-02 11:21:06 -07:00
parent 33bce9d795
commit 9e2e22f168
2 changed files with 16 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ name: DeFlock API Deploy
on:
push:
branches: [master]
branches: [ts-backend]
jobs:
deploy:

View File

@@ -36,13 +36,21 @@ const start = async () => {
// Coors Light Config
await server.register(cors, {
origin: [
'http://localhost:5173', // vite dev server
'https://deflock.me',
'https://www.deflock.me',
'https://deflock.org', // will migrate
'https://www.deflock.org', // will migrate
],
origin: (origin, cb) => {
const allowedOrigins = [
'http://localhost:5173', // vite dev server
'https://deflock.me',
'https://www.deflock.me',
'https://deflock.org', // will migrate
'https://www.deflock.org', // will migrate
];
if (!origin || allowedOrigins.includes(origin) || /^https:\/\/.*\.deflock\.pages\.dev$/.test(origin)) {
cb(null, true);
} else {
cb(null, false);
}
},
methods: ['GET', 'HEAD'],
});