From 49dbbe8fa92f1dbff99f9fe85810e9b32e77937d Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Sun, 20 Apr 2014 16:46:03 -0300 Subject: [PATCH] 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. --- README.md | 16 ++++++++++++++-- app.js | 12 ++++++++++++ package.json | 1 + 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 app.js diff --git a/README.md b/README.md index 2e7ea10b4..5b68e1dcd 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,23 @@ Copy config.template.js to config.js and edit to suit your needs. (Defaults to public PeerJS and Insight servers) Then execute these commands: - ``` npm install bower install 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 +``` diff --git a/app.js b/app.js new file mode 100644 index 000000000..543f33e01 --- /dev/null +++ b/app.js @@ -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); +}); diff --git a/package.json b/package.json index 99b94e0ee..3e3eb6eb7 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "homepage": "https://github.com/bitpay/copay", "devDependencies": { + "express": "4.0.0", "grunt-contrib-watch": "~0.5.3", "grunt-mocha-test": "~0.8.2", "grunt-shell": "~0.6.4",