0.1.2 • Published 7 years ago

hanbao-basic v0.1.2

Weekly downloads
10
License
-
Repository
github
Last release
7 years ago

Hanbao-Basic

a plugin for hanbao to add CRUD methods on models in Hanbao

install

npm install hanbao-basic

Quick Start

hanbao({
  plugins:[
    {
      plugin:"hanbao-basic",
      options:{
       sourceTypes:[
         "hanbao-basic-mongo"
       ],
       datasources:[
         {
           name:"moviedb",
           url:"mongodb://localhost:27017/moviedb",
           default:true
         }
       ]
      }
    }
  ]
}).init((err,manager)=>{
  manager.utils.getModels({name:"some-model"}).methods.read.default({}).then(data=>{
    console.log(data);
  })
})

Document

  • TODO how to create a sourceType?

API Reference

sourceType

// can be string(which is the module name or path of sourceType)
"hanbao-basic-mongo"
basicPlugin


// can be factory object
{
  name:"hanbao-basic-mongo", // or a factory method
  options:{}
}

datasource

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago