npm install js-data-server-setup
import jsDataServerSetup from 'js-data-server-setup'
const jsDataServer = new jsDataServerSetup({
expressApp,
container, // must be an instance of Container on the server
adapter
})
// setup and individual resource
jsDataServer.setupResource({
policies, // middleware/policy that is added to endpoint (see examples below)
mapperConfig
})
// after you're all done setting up resources, you need to call mount()
jsDataServer.mount()
// -- or --
// setup all resources (mount() is invoked automatically, see api docs for details)
jsDataServer.setup(resources)
See /example
dir in this repo for setup options.