Phase 1-2 of server consolidation + security hardening

This commit is contained in:
2026-05-23 17:27:22 -04:00
parent 36f23b527e
commit 1ab14ba45f
46 changed files with 1103 additions and 6826 deletions
+24
View File
@@ -0,0 +1,24 @@
export const allowedOrigins = [
'https://tools.acherryontop.com',
'https://inventory.kent.pw',
'https://acot.site',
/^http:\/\/localhost:(5174|5175)$/,
];
export const corsOptions = {
origin(origin, callback) {
if (!origin) return callback(null, true);
const ok = allowedOrigins.some((allowed) =>
allowed instanceof RegExp ? allowed.test(origin) : allowed === origin
);
if (ok) return callback(null, true);
callback(new Error('CORS not allowed'));
},
methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Authorization'],
exposedHeaders: ['Content-Type'],
credentials: true,
maxAge: 600,
};
export default corsOptions;