exoservice-sequelize-crud-handlers

Node 8 or higher

Usage no npm install needed!

<script type="module">
  import exoserviceSequelizeCrudHandlers from 'https://cdn.skypack.dev/exoservice-sequelize-crud-handlers';
</script>

README

ExoService Sequelize CRUD Handlers

Requirements

  • Node 8 or higher

Usage

const sequelizeInstance = require('...')
const sequelizeModel = require('...')
const { bootstrap } = require('exoservice')
const createHandlers = require('exoservice-sequelize-crud-handlers')

// For a CRUD only service use:
bootstrap(createHandlers({messageName: 'user', sequelizeModel, sequelizeInstance}))

// For a CRUD service with additional methods use:
const handlers = createHandlers({messageName: 'user', sequelizeModel, sequelizeInstance})
handlers['custom'] = function() { /* ... */ }
bootstrap(handlers)