Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

replicon/fortune-micro-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fortune Micro API Serializer

Build Status npm Version License

This is an ad-hoc Micro API serializer for Fortune.js.

$ npm install fortune-micro-api

Usage

import fortune from 'fortune'
import microApi from 'fortune-micro-api'

const store = fortune.create({
  serializers: [ {
    type: microApi,
    options: { ... }
  } ]
})

The options object is as follows:

  • inflectPath: pluralize the record type name in the URI. Default: true.
  • maxLimit: maximum number of records to show per page. Default: 1000.
  • includeLimit: maximum depth of fields per include. Default: 3.
  • bufferEncoding: which encoding type to use for input buffer fields. Default: base64.
  • obfuscateURIs: obfuscate URIs to encourage use of hypermedia. Default: true.
  • prefix: hyperlink prefix, without trailing slash. Default ''.

Internal options:

  • queries: queries to support, must be a set.
  • uriTemplate: URI template string.
  • allowLevel: HTTP methods to allow ordered by appearance in URI template.

License

This software is licensed under the MIT license.

About

Micro API serializer for Fortune.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%