Using hono
Course: Serverless Backends - chapter 10
What is Hono
Section titled “What is Hono”https://hono.dev/concepts/motivation

What runtimes does it support?
Section titled “What runtimes does it support?”
Working with cloudflare workers -
Section titled “Working with cloudflare workers -”- Initialize a new app
npm create hono@latest my-app- Move to
my-appand install the dependencies.
cd my-appnpm i- Hello World
import { Hono } from 'hono'const app = new Hono()
app.get('/', (c) => c.text('Hello Cloudflare Workers!'))
export default appGetting inputs from user
Section titled “Getting inputs from user”import { Hono } from 'hono'
const app = new Hono()
app.get('/', async (c) => { const body = await c.req.json() console.log(body); console.log(c.req.header("Authorization")); console.log(c.req.query("param"));
return c.text('Hello Hono!')})
export default app💡 More detail - https://hono.dev/getting-started/cloudflare-workers
Deploying
Section titled “Deploying”Make sure you’re logged into cloudflare (wrangler login)
npm run deploy