forked from tapquo/yoi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
51 lines (46 loc) · 1.59 KB
/
index.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*jslint node: true, indent: 4, maxlen: 80 */
/*
YOI
@description Easy (but powerful) NodeJS Server
@version 0.9.10
@author Javi Jimenez Villar <[email protected]> || @soyjavi
*/
"use strict";
require("coffee-script");
require("js-yaml");
require("colors");
global.config = require("../../yoi.yml");
global.config.environment = require("../../environments/" + global.config.environment + ".yml");
var Yoi = {
// Helpers
Rest : require("./lib/helpers/rest"),
Site : require("./lib/helpers/site"),
Cron : require("./lib/helpers/cron"),
Test : require("./lib/helpers/test"),
// Services
Mongo : require("./lib/services/mongo"),
Redis : require("./lib/services/redis"),
Appnima : require("./lib/services/appnima"),
// Facade
Mongoose : require("mongoose"),
Hope : require("hope"),
// Instance
run : function(callback) {
_watermark();
require("./lib/server").run(callback);
},
// Instance
test : function(callback) {
_watermark();
require("./lib/test").run();
}
};
module.exports = Yoi;
var _watermark = function() {
process.stdout.write('\u001B[2J\u001B[0;0f');
console.log('================================================================================'.rainbow);
console.log(' YOI'.rainbow, 'v0.9.10'.grey);
console.log(' Easy (but powerful) NodeJS server');
console.log('', 'http://yoi.tapquo.com'.underline.blue);
console.log('================================================================================'.rainbow);
};