Skip to content

Instantly share code, notes, and snippets.

@fzn0x
Created August 5, 2025 09:36
Show Gist options
  • Save fzn0x/b4a50c4d274b297cce2e89eff312b438 to your computer and use it in GitHub Desktop.
Save fzn0x/b4a50c4d274b297cce2e89eff312b438 to your computer and use it in GitHub Desktop.
Run Hono.js with Node.js and CommonJS | Run Hono with CommonJS
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