Created
August 5, 2025 09:36
-
-
Save fzn0x/b4a50c4d274b297cce2e89eff312b438 to your computer and use it in GitHub Desktop.
Run Hono.js with Node.js and CommonJS | Run Hono with CommonJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { serve } = require('@hono/node-server'); | |
const { Hono } = require('hono'); | |
const { cors } = require('hono/cors'); | |
const app = new Hono() | |
app.use('/api/*', cors()) | |
app.all('/api/abc', (c) => { | |
return c.json({ success: true }) | |
}) | |
serve(app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment