hono-alovajs-client
v0.1.0
Published
The hono client integrated with alova
Readme
hono-alovajs-client 
Using sxzz/ts-starter as the starter template
Features:
- Maintains the original client request method of
hono - Preserves type-safe hono rpc calling style
- Uses
alovaas the request library - Supports all request strategy features of
alova
Installation
pnpm add hono-alovajs-clientUsage
import { createAlova } from 'alova'
import adapterFetch from 'alova/fetch'
import { hac } from 'hono-alovajs-client'
import type { App } from './server'
const alova = createAlova({
baseURL: 'http://localhost:3000',
requestAdapter: adapterFetch(),
responded: (response) => response.json(),
})
const client = hac<App>(alova)
const users = await client.users.$alova.$get()Notes
- To maintain compatibility with
hono, currently only supportsalova'sfetchadapter or customfetchadapter - Request methods like
Get|Post|Put|Delete|Head|Options|Patchare provided byalova, while other methods likeurlare provided natively byhono
