import { Hono } from 'hono' const app = new Hono() // define config const OAUTH_CONFIG = { authServerUrl: 'http://localhost:3020', clientId: process.env.CLIENT_ID, // 클라이언트 등록 후 설정 필요 clientSecret: process.env.CLIENT_SECRET, // 필요한 경우 redirectUri: process.env.REDIRECT_URI, scope: 'profile' } app.get('/', (c) => { return c.html(`
토큰은 발급되었지만 프로필 조회에 실패했습니다.
상태 코드: ${profileResponse.status}
홈으로 `) } const profile = await profileResponse.json() as any // 토큰 정보와 프로필을 함께 표시 return c.html(`
${JSON.stringify(profile, null, 2)}
토큰 교환 또는 프로필 조회 중 오류가 발생했습니다: ${error?.message || '알 수 없는 오류'}
홈으로 `) } }) export default { port: 5002, fetch: app.fetch, }