Introducing zero-configuration Hono backends

Vercel now natively supports Hono, a fast, lightweight backend framework built on web standards, with zero-configuration. Unleash the power of Hono with full Node.js support.

import { Hono } from 'hono'

const app = new Hono()

app.get('/', (c) => {
  return c.text("Hello Hono!"))
})

export default app

With the code above, use Vercel CLI to develop and deploy your Hono application:

# Develop the application locally
vc dev

# Create a deployment
vc deploy

Backends on Vercel benefit from:

  • Fluid compute, with Active CPU pricing
  • Automatic cold-start optimizations
  • Background processing
  • Much more

You can deploy Hono on Vercel using our template or visit Hono’s Vercel documentation to learn more.

4 Likes

Hi @anthony-shew, where do you expect static assets? A ./public folder doesn’t work - and everything else I tried neither.

The closest I got was defining builds in vercel.json. I got my static resources deployed to a /public/ subdirectory - and a broken hono app not mounted at /.

More details of my configuration are here:

2 posts were merged into an existing topic: Feedback on v0 Transition & User Experience

Hi @anthony-shew , it appears that the zero-configuration hono build script is broken.

The starter example does not work when deployed on Vercel, if you have any relative imports.

import { Hono } from 'hono'

// This breaks the build stage on Vercel
import something from './myfile'

const app = new Hono().basePath('/api')

export default app

I think the build script for Hono might be the issue - vercel/packages/hono/src/build.ts at main · vercel/vercel · GitHub

The bug basically completely blocks anyone from deploying Hono server on Vercel.

1 Like