KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
emcee
★ 13
Open GitHub ↗
A bridge between the M and C bits of MVC
Download README (.md)
Explore Similar Repositories
dQuery
:
jQuery for Dart
director-explorer
:
HTML / Text view of `Director.router` instances
reNX
:
reNX, a C# library for reading NX files.
ecosystem
:
part of WP7: openECTS Ecosystem
snowflake
:
Twitter's Snowflake UUID generator in Erlang.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
emcee
?
Download (.md)
# emcee A model loader that a controller calls. Basically, just the M and C bits of MVC. An interface for controllers to specify that certain models will be needed, and then have them get loaded. ## Usage ```javascript var MC = require('emcee') // add a bunch of models MC.model('login', function (req, cb) { // callback is called with (er, data) req.session.get('login', cb) }) MC.model('train', function (url, res, cb) { }) // later on... http.createServer(function (req, res) { // check if the user is logged in. var m = new MC() // modelname, args... m.load('login', req) m.load('bike', req.url, res) // different kind of bike: modelname, alias, args... m.loadAs('bike', 'motorbike', 'dirt', 'roads') m.end(function (er, models) { // either there is an error, or all models are loaded on the // 'models' object. note that all errors are assumed to be // catastrophic, so you only get the first error, and the // models object will only contain the models that got loaded // before the error occurred. }) }).listen(1337) ```