moot-interface
The browser-based interface for the moot demo.
Uses: rollup, svelte, asr, mannish, etc.
run scripts
-
build
: runs all build scripts -
develop
: run watchers to rebuild on changes, run demo server
required mediator
The moot interface requires a data provider under the mediated name moot-api
.
This data provider is essentially a JSON API interface, but the moot-interface does not keep the HTTP-request opinion: you are free to create a data provider of any sort, so long as the mediated provider has a JSON API interface.
You'll need to make a provider named moot-api
:
mediator.provide('moot-api', request)
Where request
is an object with the following properties:
-
method
(string, always present): Will be a valid, upper-cased HTTP request name, e.g.GET
andPUT
. -
url
(string, always present): A valid URL of the form/${version}/${path}
whereversion
is the API version number, e.g.v1
, andpath
is the resource indicator path, e.g.secure/games/abc123
. -
filter
(object, optional): A key-value object which limits the requested resources, e.g.{ sport: 'football' }
. -
include
(object, optional): Whether to include related objects, for example{ team: true }
would include a team object in the response, if one was defined for the queried resource, while{ team: false }
would explicitly keep it from the returned data. -
fields
(object, optional): Limit the data in the response. The key is the name of the resource to limit, and the value is an array of strings which property names, e.g.{ team: [ 'name' ] }
will only include thename
properties in theteam
object.
The complete list of requests which need to be supported is available here.