summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
authorSaloniGoyal2016-06-16 11:52:24 +0530
committerSaloniGoyal2016-06-16 11:52:24 +0530
commit2cbb0645b07a1eead605874bc97a989b3fc1d89f (patch)
tree0467c5837901401f0a8fb0a54df350ed3fb9fea1 /app.js
parent988150262d52426070d892ddb7e8af09c1c60c90 (diff)
downloadeSimWebApp-2cbb0645b07a1eead605874bc97a989b3fc1d89f.tar.gz
eSimWebApp-2cbb0645b07a1eead605874bc97a989b3fc1d89f.tar.bz2
eSimWebApp-2cbb0645b07a1eead605874bc97a989b3fc1d89f.zip
plot generated using plotly.js
Diffstat (limited to 'app.js')
-rw-r--r--app.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/app.js b/app.js
index 0a72ee5..d9608e8 100644
--- a/app.js
+++ b/app.js
@@ -1,29 +1,41 @@
var express = require('express'),
path = require('path'),
- config = require('./config/config.js')
+ config = require('./config/config.js'),
+ fs = require('fs'),
+ os = require('os'),
+ shelljs = require('shelljs/global'),
+ PythonShell = require('python-shell')
var app = express();
+var scriptPath = path.join(__dirname,'views/script');
+//Set views property
app.set('views',path.join(__dirname,'views'));
+//set Template engine
app.engine('html',require('hogan-express'));
+//Set it as View engine
app.set('view engine','html');
+//Set Static public folder
app.use(express.static(path.join(__dirname,'views')));
+//Set Port to run the app
app.set('port',process.env.PORT||4000);
//Setting config
app.set('host',config.host);
//Socket IO
+//Create server which listen app
var server = require('http').createServer(app);
+//Socket.io is invoked by passing server
var io = require('socket.io')(server);
-var fs = require('fs');
var exec = require('child_process').exec;
//Routing
-require('./routes/routes.js')(express,app,io,fs,exec);
+require('./routes/routes.js')(express,app,io,fs,exec,os,PythonShell,scriptPath);
+//Listen server
server.listen(app.get('port'),function(){
console.log('eSim Runing on port : '+app.get('port'));
}) \ No newline at end of file