Live demo here
Override the default settings by defining them in config/local.js
listen
:{host: '127.0.0.1', port: 1111}
name
base_urls
: Array of URLs or a stringauth
endpoints
: list of{name: …, prefix: …, methods: {'<VERB> URI': <Method>, …}}
withVERB
being anHTTP
verb (GET
,POST
, …) andURI
an API endpoint. Ex:GET /users/{name}
custom_types
:{id: <Custom type>, …}
:id
can be anything at all as long as it does not contain any '('
Object with the following attributes:
description
auth_required
parameters
: object of the form{<NAME>: <Parameter>, …}
reponses
: object{<CODE>: <Object>, …}
where<CODE>
matches[0-9x]{3}
Object with the following attributes:
description
required
(defaultfalse
, will be changed totrue
if the parameter is in theURI
)type
: an<Object>
testing_value
: the value used when generating thecheck.{html,json}
pagesdefault
: the value the API will default to if the parameter isn't supplied
One of the following:
int
,float
,string
orbool
"value1|value2|…"
<custom type id>
{key: <Object>, …}
[<Object>]
,[<Object>, size_max]
or[<Object>, size_max, size_min]
(optional) <Object>
<Object> (description)
Object with the following attributes:
name
inline
: whether this custom type should be described in the "Custom type section" of the doc or itsname
should be copied everywhere it's mentionned along with itstype
type
:<Object>
(if notype
key is present then we fall back on the value of theinline
key)