8000 GitHub - shlroland/hono-alovajs-client: hono client for alova
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

shlroland/hono-alovajs-client

Repository files navigation

hono-alovajs-client npm

Unit Test

hono client for alova

中文文档

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 alova as the request library
  • Supports all request strategy features of alova

Installation

pnpm add hono-alovajs-client

Usage

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 supports alova's fetch adapter or custom fetch adapter
  • Request methods like Get | Post | Put | Delete | Head | Options | Patch are provided by alova, while other methods like url are provided natively by hono

License

MIT License © 2025 shlroland

About

hono client for alova

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published
0