summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/app.js b/app.js
new file mode 100644
index 0000000..b577162
--- /dev/null
+++ b/app.js
@@ -0,0 +1,42 @@
+var express = require('express'),
+ path = require('path'),
+ 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,'scripts')
+//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,'public')));
+
+//Set Port to run the app
+app.set('port',process.env.PORT||3000);
+
+//Setting config
+app.set('host',config.host);
+
+
+//Create server which listen app
+var server = require('http').createServer(app);
+//Socket.io is invoked by passing server
+var io = require('socket.io')(server);
+
+//Invokes routes.js
+require('./routes/routes.js')(express,app,fs,os,io,PythonShell,scriptPath);
+
+
+//Listen server
+server.listen(app.get('port'),function(){
+ console.log('Ngspice Simulator is running on port : '+app.get('port'));
+}) \ No newline at end of file