fix: production save errors and import HR dashboard data

Resolve invalid task creator IDs, fix API routing and file uploads on Vercel, and replace dummy seed data with HR_Dashboard import.
This commit is contained in:
EENE Dashboard
2026-06-05 22:08:56 +09:00
parent 9abb58e5c8
commit 6066b5682d
12 changed files with 488 additions and 188 deletions

View File

@@ -12,14 +12,20 @@ app.use(helmet());
const allowedOrigins = [
'http://localhost:3000',
'http://172.16.8.248:3000',
'https://eene-dashboard.vercel.app',
process.env.FRONTEND_URL,
].filter(Boolean) as string[];
function isAllowedOrigin(origin: string): boolean {
if (allowedOrigins.includes(origin)) return true;
if (/^https:\/\/[\w-]+\.vercel\.app$/.test(origin)) return true;
return false;
}
app.use(
cors({
origin: (origin, callback) => {
// 같은 서버에서 직접 호출하거나 허용된 origin이면 통과
if (!origin || allowedOrigins.includes(origin)) {
if (!origin || isAllowedOrigin(origin)) {
callback(null, true);
} else {
callback(new Error(`CORS 차단: ${origin}`));