File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change 1
- // backend/api/index.ts
2
1
import { Hono } from 'hono' ;
3
2
import { cors } from 'hono/cors' ;
4
3
5
4
const app = new Hono ( ) ;
6
5
7
- // 'cors'에 모든 옵션을 제거하여 모든 출처를 허용하도록 변경합니다.
8
- app . use ( '/ *' , cors ( ) ) ;
6
+ // 디버깅을 위해 모든 출처를 허용하는 가장 단순한 CORS 설정
7
+ app . use ( '*' , cors ( ) ) ;
9
8
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 백엔드가 응답합니다.' } ) ;
20
13
} ) ;
21
14
22
15
export default app ;
You can’t perform that action at this time.
0 commit comments