Fix serverless functions: simplify API structure

- Replace complex Express-style handler with simple module.exports
- Add separate API endpoints for better organization
- Simplify vercel.json routing configuration
- Remove ES modules to use CommonJS for Vercel compatibility
- Add dedicated test API endpoint for debugging
This commit is contained in:
2025-08-21 13:32:53 +09:00
parent ec5da4db32
commit 08894eeb66
5 changed files with 73 additions and 43 deletions

21
api/test.js Normal file
View File

@@ -0,0 +1,21 @@
// 테스트용 간단한 API
module.exports = (req, res) => {
// CORS 헤더 설정
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
if (req.method === 'OPTIONS') {
res.status(200).end();
return;
}
// 간단한 응답
res.status(200).json({
success: true,
message: 'API가 정상 작동합니다!',
timestamp: new Date().toISOString(),
url: req.url,
method: req.method
});
};