Tencent CloudBase
Tencent CloudBase is Tencent Cloud's serverless backend platform. HTTP Cloud Functions run as a plain Node.js process. Your application listens on port 9000, and CloudBase starts it through scf_bootstrap. @hono/node-server works as-is. No extra Hono adapter is required.
1. Setup
Start your project with the "create-hono" command. Select nodejs.
npm create hono@latest my-app
cd my-app
npm iyarn create hono my-app
cd my-app
yarnpnpm create hono my-app
cd my-app
pnpm ibun create hono@latest my-app
cd my-app
bun i2. Hello World
Edit src/index.ts. CloudBase HTTP Cloud Functions require port 9000.
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello CloudBase!'))
serve({
fetch: app.fetch,
port: 9000,
})3. Run
npm run devThen access http://localhost:9000.
4. Bootstrap
Create scf_bootstrap in the project root (no file extension) and make it executable:
#!/bin/bash
/var/lang/node20/bin/node dist/index.jschmod +x scf_bootstrapUse LF line endings. The Node path must match the function runtime; /var/lang/node20/bin/node is for Node.js 20.19.
5. Deploy
Build the app, then deploy an HTTP function (Node.js 20.19) with the CloudBase CLI:
npm run build
tcb fn deploy <function-name> --httpFnFor console zip upload, see the Node.js HTTP function quick start.