Skip to content

Latest commit

 

History

History

env-vars

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Setting up an API Client via Hono middleware.

Author: @dalanmiller

This example shows how to set up an API Client (Stripe) prior to handling a request.

Doing this in Typescript requires some specific configuration when instantiating the Hono app. So this example shows how to modify the Hono app instantiation Hono() in Typescript to work correctly with introduced environment variables and session variables.

Per the Cloudflare docs on using Secrets with Workers make sure you add a .dev.vars file which includes the following:

LIVEMODE=false 
STRIPE_TK=<YOUR_STRIPE_TESTMODE_KEY>