halifier-sequelize

0.0.6 • Public • Published

halifier-sequelize

extension of halifier containing extra functionality and helpers for integration with sequelize

Features

  • generation of HAL responses based on sequelize models
  • building SQL queries based on _listMeta object
  • a ready-to-go controller bound with sequelize model and providing basic HAL interface for fetching single or a list of entities

Install

npm install --save halifier-sequelize

Usage

const sequelize = someFunction(/* setup connection, define models */)
 
const app = require('express')()
 
// halifier expects app dependencies to be injected into app.context
// as if it were koa
app.context = {sequelzie}
 
const {SequelizeHalController} = require('halifier-sequelize')
 
const peopleController = new SequelizeHalController(app, {
  model: sequilize.model('Human')
})
app.use('/people', peopleController.expressRouter())

/halifier-sequelize/

    Package Sidebar

    Install

    npm i halifier-sequelize

    Weekly Downloads

    3

    Version

    0.0.6

    License

    WTFPL

    Last publish

    Collaborators

    • disjunction