Skip to content

Commit

Permalink
Add http-server dev dependency
Browse files Browse the repository at this point in the history
You can start an HTTP server to serve static assets used for development by
running

    npm run-script serve

This script will run an http-server instance with the default options. The
server will be listening by default at 0.0.0.0:8080.
  • Loading branch information
potomak committed Dec 15, 2015
1 parent 86bc385 commit 339aea6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ http://potomak.github.io/gist-txt/docs/gist-txt.html.
Generate documentation for the project by running:

```sh
$ npm run doc
npm run-script doc
```

## Building the bundle

Run:

```sh
$ npm run build
npm run-script build
```

to build a minimized bundle that contains the main script (`gist-txt.js`) and
Expand All @@ -121,30 +121,24 @@ all dependencies.
During development you want to be able to debug your code and continuously
rebuild the bundle after any change to your code.

You can run:
Run:

```sh
$ npm run watch
npm run-script watch
```

to build a development version of the bundle that includes source maps and to
automatically rebuild the bundle on code changes.

### Static server

The site can be compiled and served locally using Jekyll:

```sh
$ jekyll s
```
#### HTTP server

Or you can run a Python static server:
Run the HTTP server:

```sh
$ python -m SimpleHTTPServer
npm run-script serve
```

Note: using `SimpleHTTPServer` only `index.html` will be served correctly.
and open http://localhost:8080.

## Story development environment

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"doc": "docco gist-txt.js",
"lint": "jslint gist-txt.js",
"build": "browserify gist-txt.js | uglifyjs > bundle.js",
"watch": "watchify gist-txt.js -o bundle.js --debug --verbose"
"watch": "watchify gist-txt.js -o bundle.js --debug --verbose",
"serve": "http-server"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -36,6 +37,7 @@
"devDependencies": {
"browserify": "^9.0.3",
"docco": "^0.7.0",
"http-server": "^0.8.5",
"jslint": "^0.8.1",
"uglify-js": "^2.4.16",
"watchify": "^2.4.0"
Expand Down

0 comments on commit 339aea6

Please sign in to comment.