Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# Name <email address>

Rahul Jiresal <[email protected]>
William Le <[email protected]>
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https-pushstate-server
# pushstate-https-server

A simple static http/https file server that works with HTML5 Pushstate.

Expand All @@ -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
```

7 changes: 5 additions & 2 deletions bin/https-pushstate-server → bin/pushstate-https-server
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

'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));

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',
' -a Address to bind [127.0.0.1]',
' -p Port to use [8080]',
' -d Directories with static files, comma separated',
' -s Enable HTTPS',
Expand All @@ -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,
Expand All @@ -50,6 +52,7 @@ if (enableSSL) {

let options = {};
options.root = root;
options.address = address;
options.port = port;
options.dirs = dirs;
options.https = enableSSL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 () {
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "https-pushstate-server",
"name": "pushstate-https-server",
"version": "0.1.1",
"description": "A simple HTML 5 PushState Server with HTTPS",
"author": "Rahul Jiresal <rahul@aerofs.com>",
"main": "./lib/https-pushstate-server.js",
"author": "William Le <williamle8300@gmail.com>",
"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",
"url": "git://github.com/aerofs/https-pushstate-server.git"
"url": "git://github.com/williamle8300/pushstate-https-server.git"
},
"keywords": [
"html5",
Expand All @@ -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"
}
}