From dc7542d3a451335db00ab3bad1babeb80bd296f1 Mon Sep 17 00:00:00 2001 From: William Le Date: Sat, 17 Sep 2016 11:59:11 -0700 Subject: [PATCH 1/4] Feature: bind an address for server --- bin/https-pushstate-server | 3 +++ lib/https-pushstate-server.js | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/https-pushstate-server b/bin/https-pushstate-server index 1da8e52..b57f9e7 100755 --- a/bin/https-pushstate-server +++ b/bin/https-pushstate-server @@ -14,6 +14,7 @@ if (argv.h || argv.help || noArgs) { '', 'options:', ' -r Root Directory', + ' -a Address to bind [127.0.0.1]', ' -p Port to use [8080]', ' -d Directories with static files, comma separated', ' -s Enable HTTPS', @@ -25,6 +26,7 @@ if (argv.h || argv.help || noArgs) { } var root = argv.r, + address = argv.a || '127.0.0.1', port = argv.p || 8080, dirs = _.isEmpty(argv.d) ? [] : _.split(argv.d, ','), enableSSL = argv.s, @@ -50,6 +52,7 @@ if (enableSSL) { let options = {}; options.root = root; +options.address = address; options.port = port; options.dirs = dirs; options.https = enableSSL; diff --git a/lib/https-pushstate-server.js b/lib/https-pushstate-server.js index 2cc27a8..f639c9e 100644 --- a/lib/https-pushstate-server.js +++ b/lib/https-pushstate-server.js @@ -9,9 +9,11 @@ let express = require('express'), let pushstateServer = { server: null, + address: null, port: null, createServer: function (options) { + this.address = options.address || '127.0.0.1'; this.port = options.port || 8080; let rootDir = options.root; let dirs = options.dirs; @@ -63,7 +65,7 @@ let pushstateServer = { }, start: function (callback) { - this.server.listen(this.port, callback); + this.server.listen(this.port, this.address, callback); }, stop: function () { From abe105d20f98ec8ce79f7338be19203dadfae774 Mon Sep 17 00:00:00 2001 From: William Le Date: Sat, 17 Sep 2016 12:36:28 -0700 Subject: [PATCH 2/4] updated package.json with my info --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 6e773d7..09c744b 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "https-pushstate-server", + "name": "pushstate-https-server", "version": "0.1.1", "description": "A simple HTML 5 PushState Server with HTTPS", - "author": "Rahul Jiresal ", + "author": "William Le ", "main": "./lib/https-pushstate-server.js", "bin": { "https-pushstate-server": "./bin/https-pushstate-server", @@ -10,7 +10,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/aerofs/https-pushstate-server.git" + "url": "git://github.com/williamle8300/pushstate-https-server.git" }, "keywords": [ "html5", @@ -28,6 +28,6 @@ "path": "^0.12.7" }, "bugs": { - "url": "https://github.com/aerofs/https-pushstate-server/issues" + "url": "https://github.com/williamle8300/pushstate-https-server/issues" } } From 7be696c8d19b0bf284bad9541f8e2e08df4a1ec4 Mon Sep 17 00:00:00 2001 From: William Le Date: Sat, 17 Sep 2016 12:37:41 -0700 Subject: [PATCH 3/4] renamed files --- bin/{https-pushstate-server => pushstate-https-server} | 4 ++-- lib/{https-pushstate-server.js => pushstate-https-server.js} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename bin/{https-pushstate-server => pushstate-https-server} (94%) rename lib/{https-pushstate-server.js => pushstate-https-server.js} (100%) diff --git a/bin/https-pushstate-server b/bin/pushstate-https-server similarity index 94% rename from bin/https-pushstate-server rename to bin/pushstate-https-server index b57f9e7..f3ae797 100755 --- a/bin/https-pushstate-server +++ b/bin/pushstate-https-server @@ -2,7 +2,7 @@ 'use strict'; -var pushstateServer = require('../lib/https-pushstate-server'), +var pushstateServer = require('../lib/pushstate-https-server'), _ = require('lodash'), argv = require('minimist')(process.argv.slice(2)); @@ -10,7 +10,7 @@ let noArgs = _.isEmpty(argv._) && _.size(_.keys(argv)) == 1; if (argv.h || argv.help || noArgs) { console.log([ - 'usage: https-pushstate-server [options]', + 'usage: pushstate-https-server [options]', '', 'options:', ' -r Root Directory', diff --git a/lib/https-pushstate-server.js b/lib/pushstate-https-server.js similarity index 100% rename from lib/https-pushstate-server.js rename to lib/pushstate-https-server.js From ffa5d2d6ff8b0cac7dce87a5c7e5c6c2ca05973c Mon Sep 17 00:00:00 2001 From: William Le Date: Mon, 19 Sep 2016 17:31:49 -0700 Subject: [PATCH 4/4] asdf --- CONTRIBUTORS | 1 + README.md | 6 +++--- package.json | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index ad6ac63..2d0491e 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2,3 +2,4 @@ # Name Rahul Jiresal +William Le diff --git a/README.md b/README.md index 8bc9321..a560437 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# https-pushstate-server +# pushstate-https-server A simple static http/https file server that works with HTML5 Pushstate. @@ -14,11 +14,11 @@ For example, ### Install -`npm install git+ssh://github.com/aerofs/https-pushstate-server.git --save` +`npm install git+ssh://github.com/williamle8300/pushstate-https-server.git --save` ### Usage ```shell -$ https-pushstate-server -r rootDir -p 8000 -s -c certFile -k keyFile -d assets,styles,scripts +$ pushstate-https-server -r rootDir -p 8000 -s -c certFile -k keyFile -d assets,styles,scripts ``` diff --git a/package.json b/package.json index 09c744b..e8e77c1 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "0.1.1", "description": "A simple HTML 5 PushState Server with HTTPS", "author": "William Le ", - "main": "./lib/https-pushstate-server.js", + "main": "./lib/pushstate-https-server.js", "bin": { - "https-pushstate-server": "./bin/https-pushstate-server", - "hs": "./bin/https-pushstate-server" + "pushstate-https-server": "./bin/pushstate-https-server", + "hs": "./bin/pushstate-https-server" }, "repository": { "type": "git",