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:
@@ -19,7 +19,7 @@ npm install
|
|||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open http://0.0.0.0:3000 in a web browser.
|
Then open http://127.0.0.1:3000 in a web browser.
|
||||||
|
|
||||||
## Addons
|
## Addons
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
#! /usr/bin/env sh
|
|
||||||
|
|
||||||
# Development server for xterm.js
|
|
||||||
node demo/app.js
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
#
|
|
||||||
# Testing script for xterm.js
|
|
||||||
|
|
||||||
node_modules/.bin/mocha $@
|
|
||||||
+2
-2
@@ -22,7 +22,7 @@ app.ws('/bash', function(ws, req) {
|
|||||||
/**
|
/**
|
||||||
* Open bash terminal and attach it
|
* Open bash terminal and attach it
|
||||||
*/
|
*/
|
||||||
var term = pty.spawn('bash', [], {
|
var term = pty.spawn(process.platform === 'win32' ? 'cmd.exe' : 'bash', [], {
|
||||||
name: 'xterm-color',
|
name: 'xterm-color',
|
||||||
cols: 80,
|
cols: 80,
|
||||||
rows: 24,
|
rows: 24,
|
||||||
@@ -46,7 +46,7 @@ app.ws('/bash', function(ws, req) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var port = process.env.PORT || 3000,
|
var port = process.env.PORT || 3000,
|
||||||
host = '0.0.0.0';
|
host = '127.0.0.1';
|
||||||
|
|
||||||
console.log('App listening to http://' + host + ':' + port);
|
console.log('App listening to http://' + host + ':' + port);
|
||||||
app.listen(port, host);
|
app.listen(port, host);
|
||||||
|
|||||||
+2
-2
@@ -13,7 +13,7 @@
|
|||||||
"chai": "3.5.0"
|
"chai": "3.5.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "bash bin/server",
|
"start": "node demo/app.js",
|
||||||
"test": "bash bin/test --recursive"
|
"test": "node_modules/.bin/mocha --recursive"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user