Fastly Compute
Fastly Compute is an advanced edge computing system that runs your code, in your favorite language, on our global edge network. Hono also works on Fastly Compute.
You can develop the application locally and publish it with a few commands using Fastly CLI.
1. Setup
A starter for Fastly Compute is available. Start your project with "create-hono" command. Select fastly
template for this example.
npm create hono@latest my-app
yarn create hono my-app
pnpm create hono my-app
bun create hono@latest my-app
deno init --npm hono my-app
Move to my-app
and install the dependencies.
cd my-app
npm i
cd my-app
yarn
cd my-app
pnpm i
cd my-app
bun i
2. Hello World
Edit src/index.ts
:
// src/index.ts
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello Fastly!'))
app.fire()
3. Run
Run the development server locally. Then, access http://localhost:7676
in your Web browser.
npm run start
yarn start
pnpm run start
bun run start
4. Deploy
To build and deploy your application to your Fastly account, type the following command. The first time you deploy the application, you will be prompted to create a new service in your account.
If you don't have an account yet, you must create your Fastly account.
npm run deploy
yarn deploy
pnpm run deploy
bun run deploy