Class: ModelAPIExpress

ModelAPIExpress

ModelAPIExpress - Express application that provides an RESTfull API for different models

Constructor

new ModelAPIExpress(optionsopt) → {ModelAPIExpress}

Parameters:
Name Type Attributes Description
options Object <optional>
API configuration parameters
Properties
Name Type Attributes Description
title String the title of API
version String the version of API
path String the path of api root. The application doesn't mount it self on this path.
host String the host to reach API.
options Boolean <optional>
allows or denies the OPTION end-point on the application level
transformResponse function <optional>
the function to transform standard response. For details see Transform response
Source:
Returns:
Created API application
Type
ModelAPIExpress

Members

SWAGGER_SUPPORT

SWAGGER_SUPPORT indicates that the module version supports the swagger
Source:

Methods

expose(pathopt, middlewareopt, model, routerOptionsopt) → {ModelAPIExpress}

ModelAPIExpress.prototype.expose - exposes the mongoose model as RESTFull json service
Parameters:
Name Type Attributes Description
path String <optional>
the path to mount exposed model
middleware function <optional>
one or more middlewares that should be called before each end-point controller
model Mongoose.Model Mongoosee model to be exposed
routerOptions Object <optional>
ModelAPIRouter configuration object (see [Router configuration](configuration.html#router))
Source:
Returns:
itself
Type
ModelAPIExpress

urls() → {Array}

ModelAPIExpress.prototype.urls - returns avaliable list of end-points
Source:
Returns:
list of end-points
Type
Array