1.0.4 • Published 2 years ago

@mtraders/content-api v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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)
})

License

MIT license