feature(server) add express

This commit is contained in:
coderaiser 2013-10-23 12:01:17 +00:00
parent bb7156df5e
commit 7b92cb55aa
2 changed files with 11 additions and 3 deletions

View file

@ -27,8 +27,9 @@
http = main.http,
https = main.https,
Util = main.util,
express = main.require('express'),
Server, Rest, Route, Minimize;
app, Server, Rest, Route, Minimize;
/* базовая инициализация */
function init(pAppCachProcessing) {
@ -93,7 +94,13 @@
},
lHTTPServer = function() {
Server = http.createServer( controller );
if (express) {
app = express(),
app.all('*', controller);
Server = http.createServer(app);
} else
Server = http.createServer(controller);
Server.on('error', Util.log);
Server.listen(lPort, lIP);
lServerLog(lHTTP, lPort);

View file

@ -19,7 +19,8 @@
"dependencies": {
"dropbox": "0.10.2",
"minify": "0.2.2",
"socket.io": "0.9.16"
"socket.io": "0.9.16",
"express": "3.4.2"
},
"devDependencies": {},
"license": "MIT",