Skip to content

Commit 42e031f

Browse files
committed
start terminal server from indexjs
1 parent e56b4a5 commit 42e031f

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ function addGitPath() {
4040
function startElectron() {
4141
addGitPath();
4242
setTimeout(startServer, 0);
43+
var terminalServer = require('./server.js');
44+
terminalServer.terminalServer(5000);
4345
setTimeout(createWebWindow, 1000);
4446
}
4547

server.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ app.all('/*', function(req, res, next) {
1818
next();
1919
});
2020

21+
app.get("/terminalserver", function(req, res) {
22+
res.send("running terminalserver");
23+
});
24+
2125
app.get("/kill/*", function(req, res) {
2226
let id = req.params[0];
2327
console.log(runningProcesses);
@@ -69,7 +73,15 @@ app.get("/new/*", function(req, res){
6973
res.send(id);
7074
});
7175

72-
var port = process.env.PORT || 5000;
73-
app.listen(port, function() {
74-
console.log("Listening on " + port);
75-
});
76+
// var port = process.env.PORT || 5000;
77+
// app.listen(port, function() {
78+
// console.log("Listening on " + port);
79+
// });
80+
81+
module.exports = {
82+
terminalServer: function (port) {
83+
app.listen(port, function() {
84+
console.log("Listening on " + port);
85+
});
86+
}
87+
};

0 commit comments

Comments
 (0)