이벤트 개발완료
This commit is contained in:
+6
-7
@@ -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'));
|
||||
});
|
||||
|
||||
// 서버 시작
|
||||
|
||||
Reference in New Issue
Block a user