hostr v3.1.0
hostr
Great for testing quick HTML code.
A simple web server for the current working directory. Used for hello world style web sites hosting only files in current directory structure.
Serves up files and caches files for quick responses.
Watches directory structure and refreshes on file changes through LiveReload.
Installation
Run the following
npm install hostr -gUse
Run the following command to host the current working directory
cd project/my_development_project
hostrA simple web server will be hosted at
http://localhost:3000To host at a different port, set the PORT environment variable (For example, host on port 8080).
hostr --port 8080Watch Changes
To disable watching (debugging only)
hostr --watch offTo ignore files create a .hostrignore file in the current working directory using minimatch notation
file
directory/all/files/**/*
directory/*For more information check out minimatch
LiveReload
LiveReload is used for development. hostr monitors your files. When a file save occurs LiveReload communicates with your site and pushes a refresh to your browser (e.g. - iPhone/Android/Blackberry, Desktop-Chrome/IE/Safari) so that your changes are immediately visible.
Communication between hostr and LiveReload occur through WebSockets. You must use a WebSocket enabled browser.
To use LiveReload (additional instructions):
Add the following code to your HTML:
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>Then run hostr and when file changes are detected your browser will refresh.
cd project/my_development_project
hostrLiveReload port can be changed (default: 35729), to use port 32021
hostr --livereload-port 32021To disable LiveReload
hostr --livereload offCache
To change cache expiration time (seconds, default: 60)
host --cache-expiration 5Quiet Mode
To run quietly use
hostr --quietAnd output will be suppressed
Contribute
If you've got ideas on how to make hostr better create an issue and mark an enhancement in Github.
License
Copyright (c) 2014 Henry Tseng
Released under the MIT license. See LICENSE for details.
11 months ago
4 years ago
4 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago