Module: js-data-express

Registered as js-data-express in NPM.

Details
Source
index.js, line 162
Examples

Install from NPM

npm i --save js-data-express@beta js-data@beta

ES2015 modules import

import {Router} from 'js-data-express'
const adapter = new Router()

CommonJS import

var Router = require('js-data-express').Router
var adapter = new Router()

Members


<static> mount

Convenience method that mounts queryParser and a store.

Details
Type Source
Function index.js, line 90
Examples

Mount queryParser and store at "/"

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 queryParser and store at "/api"

mount(app, store, '/api')

<static> Router

Router class.

Details
Type Source See
Constructor index.js, line 146
  • Router
Examples

ES2015 modules import

import {Router} from 'js-data-express'
const adapter = new Router()

CommonJS import

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 122
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

ES2015 modules import

import {version} from 'js-data-express'
console.log(version.full)

CommonJS import

var version = require('js-data-express').version
console.log(version.full)