@mtraders/content-api
v1.0.4
Published
Halo content api client.
Downloads
2
Readme
Installation
npm install @mtraders/content-api --save
Usage
Here is a simple code for obtaining a list of posts.
import { ContentApiClient, HaloRestAPIClient } from '@mtraders/content-api'
// http request tool for halo rest api.
const haloRestApiClient = new HaloRestAPIClient({
baseUrl: process.env.HALO_BASE_URL,
auth: { apiToken: process.env.HALO_API_TOKEN },
})
// create contentApiClient by haloRestApiCLient.
const haloContentClient = new ContentApiClient(haloRestApiClient)
// obtaining a list of articles.
haloContentClient.post.list().then((res) => {
console.log(res)
})