A minimal example showing how to deploy a Hono web app on ArvanCloud Edge Computing.
This project demonstrates how to build and bundle a Hono app and run it in Arvan's edge function environment using the r1ec CLI.
- ✅ Lightweight API using Hono (a super-fast edge framework)
- 🚀 Deployable on ArvanCloud Edge Compute
- 🔁 Portable to other edge platforms like Cloudflare Workers, Deno Deploy, Bun, etc.
git clone https://github.com/amirparsadd/r1ec-edge-hono.git
cd r1ec-edge-hono
npm installThe main logic lives in src/index.ts
npm run buildThis will generate a bundled dist/index.js using rollup, ready for edge deployment.
First, install and login to the CLI:
npm install -g r1ec
r1ec login -m YOUR_MACHINE_KEYThen deploy:
r1ec deploy test -f dist/index.jsYou'll receive a public edge URL in the panel.
curl https://test.amirparsab9.arvanedge.ir/Response:
{ "message":"Hello World" }ArvanCloud Edge expects a JavaScript file that exports a fetch(request) handler. Hono supports this natively:
// Make it compatible with R1EC
export default {
async fetch(request: Request) {
return app.fetch(request)
}
}This wrapper allows Arvan to treat the Hono app as an Edge Function.
MIT