example-hono-api
example-hono-api copied to clipboard
An example of how to create a publishable and fully type-safe API using Hono.
example-hono-api
An example of how to create a publishable and fully type-safe API using Hono.
A RPC client is exposed and can be published as a package to be consumed by other applications.
What's inside?
Projects
-
api
– a Cloudflare Worker that exposes a RPC client -
app
– a Remix app that consumes the API
Tech Stack
Setup
Install dependencies
pnpm install -r
Usage
Run commands project-wide with pnpm run <command>
.
Commands
-
dev
– start the development servers -
build
– build the production bundles -
lint
– lint the codebase -
test
– run the tests
Dev
1. Start the development servers
pnpm run dev
You should see an output containing:
api:dev: ⬣ Listening at http://0.0.0.0:8787
app:dev: Remix App Server started at http://localhost:3000
2. Open the app
Find the app
URL in the output and open it in your browser.
3. Making changes
You can make changes in any of the projects and the development servers will automatically reload ✨