import { serve } from '@hono/node-server' import { serveStatic } from '@hono/node-server/serve-static' import { cors } from 'hono/cors' import { Hono } from 'hono' const app = new Hono() app.get('/', (c) => { return c.text('Hello Hono!') }) app.use( '/static/*', cors({ origin: '*', allowHeaders: ['X-Custom-Header', 'Upgrade-Insecure-Requests'], allowMethods: ['POST', 'GET', 'OPTIONS'], exposeHeaders: ['Content-Length', 'X-Kuma-Revision'], maxAge: 600, credentials: true, }) ) app.use('/static/*', serveStatic({ root: './' })) serve({ fetch: app.fetch, port: 3000 }, (info) => { console.log(`Server is running on http://localhost:${info.port}`) })