forked from springmeyer/bones
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bones.js
34 lines (27 loc) · 1.08 KB
/
bones.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
if (global.__BonesPlugin__) {
console.trace("\033[0;31mMultiple instances of bones are not supported.\033[0m");
process.exit(4);
}
exports.$ = require('jquery')(require("jsdom").jsdom().defaultView);
exports._ = require('underscore');
exports.mirror = require('mirror');
exports.utils = require('bones/server/utils');
exports.middleware = require('bones/server/middleware');
exports.server = true;
exports.Backbone = require('bones/server/backbone');
exports.Controller = require('bones/server/controller');
exports.Model = require('bones/server/model');
exports.Collection = require('bones/server/collection');
exports.View = require('bones/server/view');
exports.Server = require('bones/server/server');
exports.Command = require('bones/server/command');
exports.load = function(dir) {
return exports.plugin.load(dir);
};
exports.start = function(callback) {
return exports.plugin.start(callback);
};
var Plugin = require('./server/plugin');
global.__BonesPath__ = require.resolve('bones');
exports.plugin = global.__BonesPlugin__ = new Plugin();
exports.plugin.load(__dirname);