Skip to content

Commit 8cff0d2

Browse files
committed
1 parent e1ebc15 commit 8cff0d2

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

backend/api/index.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
// backend/api/index.ts
21
import { Hono } from 'hono';
32
import { cors } from 'hono/cors';
43

54
const app = new Hono();
65

7-
// 'cors'에 모든 옵션을 제거하여 모든 출처를 허용하도록 변경합니다.
8-
app.use('/*', cors());
6+
// 디버깅을 위해 모든 출처를 허용하는 가장 단순한 CORS 설정
7+
app.use('*', cors());
98

10-
// --- 나머지 코드는 그대로 둡니다 ---
11-
12-
app.get('/', (c) => {
13-
return c.text('Hello Hono from the backend root!');
14-
});
15-
16-
app.get('/greet', (c) => {
17-
console.log('✅ GET /api/greet 요청 받음');
18-
const message = '안녕하세요!! Hono 백엔드에서 보내는 메시지입니다. 👋';
19-
return c.json({ message: message });
9+
// 다른 모든 라우트를 제거하고, 오직 이 테스트 라우트만 남깁니다.
10+
// 파일 경로가 'api/index.ts' 이므로 최종 경로는 '/api/test-route' 가 됩니다.
11+
app.get('/test-route', (c) => {
12+
return c.json({ message: '✅ 라우팅 테스트 성공! Hono 백엔드가 응답합니다.' });
2013
});
2114

2215
export default app;

0 commit comments

Comments
 (0)