Registered as js-data-express
in NPM.
Examples
npm i --save js-data-express@rc js-data@rc
import { Router } from 'js-data-express';
const adapter = new Router();
var Router = require('js-data-express').Router;
var adapter = new Router();
Members
-
<static> Router
-
Router class.
DetailsType Source See Constructor index.js, line 344 Examplesimport { Router } from 'js-data-express'; const adapter = new Router();
var Router = require('js-data-express').Router; var adapter = new Router();
-
<static> version
-
Details of the current version of the
js-data-express
module.Properties:
Name Type Description version.full
String The full semver value.
version.major
Number The major version number.
version.minor
Number The minor version number.
version.patch
Number The patch version number.
version.alpha
String | Boolean The alpha version value, otherwise
false
if the current version is not alpha.version.beta
String | Boolean The beta version value, otherwise
false
if the current version is not beta.Examplesimport { version } from 'js-data-express'; console.log(version.full);
var version = require('js-data-express').version; console.log(version.full);
Methods
-
<static> mount(app, store, config)
-
Convenience method that mounts queryParser and a store.
Method parameters:Name Type Argument Description app
* store
Object Instance of
Mapper
,Container
,SimpleStore
, orDataStore
.config
Config | String <optional>
Configuration options.
Examplesimport express from 'express'; import { mount, queryParser, Router } from 'js-data-express'; import { Container } from 'js-data'; const app = express(); const store = new Container(); const UserMapper = store.defineMapper('user'); const CommentMapper = store.defineMapper('comment'); mount(app, store);
mount(app, store, '/api');