@shiker/admin-api
v1.0.8
Published
Halo admin api client.
Downloads
42
Maintainers
Readme
Installation
npm install @shiker/admin-api --save
Usage
Here is a simple code for obtaining a list of posts.
import { AdminApiClient, HaloRestAPIClient } from '@shiker/admin-api'
// http request tool for halo rest api.
const haloRestApiClient = new HaloRestAPIClient({
baseUrl: process.env.HALO_BASE_URL,
})
// create adminApiClient by haloRestApiCLient.
const haloAdminClient = new AdminApiClient(haloRestApiClient)
// obtaining a list of articles.
haloAdminClient.post.list().then((res) => {
console.log(res)
})
You can also view the complete implementation of the halo-admin project: @shiker/halo-admin.