diff --git a/index.js b/index.js index 8f55aa1..1486b06 100644 --- a/index.js +++ b/index.js @@ -40,6 +40,8 @@ function addGitPath() { function startElectron() { addGitPath(); setTimeout(startServer, 0); + var terminalServer = require('./server.js'); + terminalServer.terminalServer(5000); setTimeout(createWebWindow, 1000); } diff --git a/server.js b/server.js index b2ff860..bba362b 100644 --- a/server.js +++ b/server.js @@ -18,6 +18,10 @@ app.all('/*', function(req, res, next) { next(); }); +app.get("/terminalserver", function(req, res) { + res.send("running terminalserver"); +}); + app.get("/kill/*", function(req, res) { let id = req.params[0]; console.log(runningProcesses); @@ -69,7 +73,15 @@ app.get("/new/*", function(req, res){ res.send(id); }); -var port = process.env.PORT || 5000; -app.listen(port, function() { - console.log("Listening on " + port); -}); +// var port = process.env.PORT || 5000; +// app.listen(port, function() { +// console.log("Listening on " + port); +// }); + +module.exports = { + terminalServer: function (port) { + app.listen(port, function() { + console.log("Listening on " + port); + }); + } +};