Module: js-data-express

Registered as js-data-express in NPM.

Details
Source
index.js, line 360
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.

Details
Type Source See
Constructor index.js, line 344
Examples

import { 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.

Details
Type Source
Object index.js, line 320
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.

Examples

import { 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, or DataStore.

config Config | String <optional>

Configuration options.

Details
Source
index.js, line 283
Examples

import 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');