Deploy Hono
Stackpad auto-detects Hono applications and deploys them as Node.js servers.
Quick deploy
- Push your Hono project to GitHub
- Create a new project on Stackpad and select your repo
- Stackpad detects
honoin your dependencies - Your API is live at
your-project.your-org.stackpad.eu
Configuration
Make sure your app listens on a port from the environment:
import { Hono } from 'hono';import { serve } from '@hono/node-server';
const app = new Hono();
app.get('/', (c) => c.json({ status: 'ok' }));
app.get('/health', (c) => c.json({ healthy: true }));
serve({ fetch: app.fetch, port: Number(process.env.PORT) || 3000,});The default port is 3000. Stackpad runs the start script from your package.json:
{ "scripts": { "build": "tsc", "start": "node dist/index.js" }}Database
Hono APIs commonly need a database. Add PostgreSQL to your project:
import { Hono } from 'hono';import { Pool } from 'pg';
const pool = new Pool({ connectionString: process.env.DATABASE_URL,});
const app = new Hono();
app.get('/users', async (c) => { const result = await pool.query('SELECT * FROM users'); return c.json(result.rows);});Remember to redeploy after adding the database service.
What’s next?
- Environment variables — manage configuration
- PostgreSQL — database setup
- Connecting services — private networking