Fastly [email protected]
Fastly's [email protected] offering allows us to build high scale, globally distributed applications and execute code at the edge of Fastly CDN.
Hono also works on Fastly [email protected]
1. Install CLI
To use [email protected], you must create a Fastly account if you don't already have one. Then, install Fastly CLI.
macOS
brew install fastly/tap/fastly
brew install fastly/tap/fastly
Follow this link for other OS:
2. Setup
A starter for Fastly [email protected] is available. Start your project with "create-hono" command.
npm create [email protected] my-app
npm create [email protected] my-app
Move to my-app
and install the dependencies.
cd my-app
npm i
cd my-app
npm i
3. Hello World
Edit src/index.ts
:
ts
// src/index.ts
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello Fastly!'))
app.fire()
// 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 dev
npm run dev
4. Deploy
npm run deploy
npm run deploy
That's all!!