1.0.8 • Published 12 months ago
@flyodev/nitrocms-js v1.0.8
nitrocms
yarn add @flyodev/nitrocms-js
Getting Started
Please follow the installation instruction and execute the following JS code:
import { ApiClient, ConfigApi, PagesApi } from '@flyodev/nitrocms-js'
var defaultClient = ApiClient.instance;
defaultClient.defaultHeaders = {}
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "INSERT_YOUR_TOKEN_HERE"
// the config data contains all informations, including all pages to retrieve further informations like page content:
const configData = await new ConfigApi().config()
// retrieve a the content for home page
const homeData = await new PagesApi().home()
// trieve information by a certain slug
const pageData = await new PagesApi().page({slug: 'the/slug/of/the/page'})
Documentation for API Endpoints
All URIs are relative to https://api.flyo.cloud/nitro
Class | Method | HTTP request | Description |
---|---|---|---|
ConfigApi | config | GET /config | Get Config |
PagesApi | home | GET /pages/home | Get Home |
PagesApi | pages | GET /pages | Get Pages |
SitemapApi | pages | GET /sitemap | Get Pages |
ContentApi | pages | PUT /content/{pageId} | Put Content |