Skip to Content

Last Updated: 3/11/2026


Fastly Compute

Fastly Compute  is an edge computing platform that runs code on Fastly’s global edge network.

Setup

Create a new Fastly Compute project:

npm create hono@latest my-app

Select fastly, then install dependencies:

cd my-app npm install

Hello World

Edit src/index.ts:

import { Hono } from 'hono' import { fire } from '@fastly/hono-fastly-compute' const app = new Hono() app.get('/', (c) => c.text('Hello Fastly!')) fire(app)

Note: When using fire from @fastly/hono-fastly-compute, import Hono from 'hono' rather than 'hono/quick'.

Run Locally

Start the development server:

npm run start

Access http://localhost:7676 in your browser.

Deploy

Deploy to your Fastly account (you’ll be prompted to create a service on first deploy):

npm run deploy

If you don’t have an account, create one here .

Bindings

Access Fastly platform resources (KV Stores, Config Stores, Backends):

import { buildFire } from '@fastly/hono-fastly-compute' const fire = buildFire({ siteData: 'KVStore:site-data', }) const app = new Hono<{ Bindings: typeof fire.Bindings }>() app.put('/upload/:key', async (c) => { const key = c.req.param('key') await c.env.siteData.put(key, c.req.body) return c.text(`Put ${key} successfully!`) }) fire(app)