이벤트 개발완료

This commit is contained in:
2025-10-23 22:04:03 +09:00
parent ce1aee67d6
commit cd0e139b5e
48 changed files with 7855 additions and 3459 deletions
+6 -7
View File
@@ -34,7 +34,7 @@ function getDomain(origin) {
}
}
const allowedDomains = ['lanebow.com', 'localhost'];
const allowedDomains = ['lanebow.com', 'www.lanebow.com', 'localhost'];
app.use(cors({
origin: function(origin, callback) {
@@ -159,18 +159,17 @@ app.use('/api/users', userRoutes);
app.use('/api/notifications', notificationRoutes);
app.use('/api/menus', menuRoutes);
// 정적 파일 제공 설정
// 정적 파일 제공 설정 (Flutter Web 빌드 산출물)
const path = require('path');
app.use(express.static(path.join(__dirname, '../frontend/dist')));
const WEB_ROOT = process.env.FRONTEND_ROOT || path.join(__dirname, '../public');
app.use(express.static(WEB_ROOT));
// API 요청이 아닌 모든 요청은 Vue 앱으로 라우팅
// API 요청이 아닌 모든 요청은 Flutter Web 앱으로 라우팅 (SPA Fallback)
app.get('*', (req, res, next) => {
// API 요청은 무시하고 다음 미들웨어로 전달
if (req.path.startsWith('/api/')) {
return next();
}
// Vue 앱의 index.html 반환
res.sendFile(path.join(__dirname, '../frontend/dist/index.html'));
res.sendFile(path.join(WEB_ROOT, 'index.html'));
});
// 서버 시작