add simplest possible express server to host files

...this is much better for development, so you can run many different servers
that have different HTML 5 local storages for testing purposes.
This commit is contained in:
Ryan X. Charles 2014-04-20 16:46:03 -03:00
parent 4ea7a2c785
commit 49dbbe8fa9
3 changed files with 27 additions and 2 deletions

View File

@ -7,11 +7,23 @@ Copy config.template.js to config.js and edit to suit your needs. (Defaults to
public PeerJS and Insight servers) public PeerJS and Insight servers)
Then execute these commands: Then execute these commands:
``` ```
npm install npm install
bower install bower install
grunt --target=dev shell grunt --target=dev shell
node app.js
``` ```
Then open index.html in your browser. To run on a different port:
```
PORT=3001 node app.js
```
To open up five different instances to test 3-of-5 multisig with yourself, then run this in 5 different terminals:
```
PORT=3001 node app.js
PORT=3002 node app.js
PORT=3003 node app.js
PORT=3004 node app.js
PORT=3005 node app.js
```

12
app.js Normal file
View File

@ -0,0 +1,12 @@
var express=require("express");
var http=require("http");
var app=express();
var port = process.env.PORT || 3000;
app.set("port", port);
app.use(express.static(__dirname));
app.listen(port, function(){
console.log("Listening at: http://localhost:" + port);
});

View File

@ -19,6 +19,7 @@
}, },
"homepage": "https://github.com/bitpay/copay", "homepage": "https://github.com/bitpay/copay",
"devDependencies": { "devDependencies": {
"express": "4.0.0",
"grunt-contrib-watch": "~0.5.3", "grunt-contrib-watch": "~0.5.3",
"grunt-mocha-test": "~0.8.2", "grunt-mocha-test": "~0.8.2",
"grunt-shell": "~0.6.4", "grunt-shell": "~0.6.4",