Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

101 Commits

Repository files navigation

Facet Core

Base object that provides common functionality and gets extended by the other facet modules. Core offers access to the following functionality:

  • Abstration of middleware specific code for framework agnostic use
  • Handling of request/response lifecycle
  • Built in CRUD functionality via find, findOne, create, update, delete functions for any resource you create
  • Management of event bus (aka Intercom) used for decoupled module communication

Example

"use strict";varutil=require('util'),ApiCore=require('facet-core').ApiCore;varProductAPI=function(options){};/** * Product API inherits from Core API */util.inherits(ProductAPI,ApiCore);// query.conditions, query.fields, and query.options // are regular mongoose queriesvarquery={conditions: {name: 'Cool Item'},fields: '',options: {lean: true}}// FacetApiCore.find() is a wrapper for mongoose's find(), same // with findOne(), create(), remove() and update()ProductAPI.find(query,successCb,errorCb);

About

Base object that provides common functionality and gets extended by the other facet modules

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages