Get demo working on Windows

- Removed bin bash scripts in favor of npm scripts so they work
  cross-platform
- Moved to use 127.0.0.1 as 0.0.0.0 doesn't work on Windows

Note that this doesn't work with the current pty.js as it doesn't build on
Windows.
This commit is contained in:
Daniel Imms
2016-06-13 15:55:47 -07:00
parent 9d34ed8781
commit 623853f3f4
5 changed files with 5 additions and 14 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ app.ws('/bash', function(ws, req) {
/**
* Open bash terminal and attach it
*/
var term = pty.spawn('bash', [], {
var term = pty.spawn(process.platform === 'win32' ? 'cmd.exe' : 'bash', [], {
name: 'xterm-color',
cols: 80,
rows: 24,
@@ -46,7 +46,7 @@ app.ws('/bash', function(ws, req) {
});
var port = process.env.PORT || 3000,
host = '0.0.0.0';
host = '127.0.0.1';
console.log('App listening to http://' + host + ':' + port);
app.listen(port, host);