Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergiocarneiro/example-hono-api
An example of how to create a publishable and fully type-safe API using Hono.
https://github.com/sergiocarneiro/example-hono-api
api cloudflare-workers hono remix rpc
Last synced: 8 days ago
JSON representation
An example of how to create a publishable and fully type-safe API using Hono.
- Host: GitHub
- URL: https://github.com/sergiocarneiro/example-hono-api
- Owner: sergiocarneiro
- Created: 2023-03-13T00:30:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-05T01:54:55.000Z (over 1 year ago)
- Last Synced: 2024-11-02T14:34:04.180Z (15 days ago)
- Topics: api, cloudflare-workers, hono, remix, rpc
- Language: TypeScript
- Homepage:
- Size: 112 KB
- Stars: 23
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# example-hono-api
An example of how to create a publishable and fully type-safe API using [Hono](https://hono.dev).
A [RPC client](https://hono.dev/guides/rpc) is exposed and can be published as a package to be consumed by other applications.
## What's inside?
### Projects
- `api` – a [Cloudflare Worker](https://workers.cloudflare.com) that exposes a [RPC client](https://hono.dev/guides/rpc)
- `app` – a [Remix](https://remix.run/) app that consumes the API### Tech Stack
- [Hono](https://hono.dev)
- [Cloudflare Workers](https://workers.cloudflare.com)
- [Remix](https://remix.run)
- [Turborepo](https://turbo.build/repo)
- [pnpm](https://pnpm.io)## Setup
Environment setup
### Install pnpm
```sh
corepack prepare pnpm@latest --activate
```
[More alternatives](https://pnpm.io/installation)### Install dependencies
```sh
pnpm install -r
```## Usage
Run commands project-wide with `pnpm run `.
### 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
```sh
pnpm run dev
```You should see an output containing:
```sh
api:dev: ⬣ Listening at http://0.0.0.0:8787
```
```sh
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 ✨
## Perks
- [Using with Remix](https://github.com/sergiocarneiro/example-hono-api/blob/main/apps/app/README.md)