`dirvhost` is a simple command-line utility that serves all subdirectories of a selected directory as separate virtual hosts. Host names are dir names with `.local` appended. Default port is 4000.
npm install dirvhost
|13||downloads in the last month|
|Version||0.0.6 last updated a year ago|
dirvhost is a simple command-line utility that serves all subdirectories of a selected directory as separate virtual hosts. Host names are dir names with
.local appended. Default port is 4000.
I find it super useful when having many static web projects going on.
For example if you have a directory
Projects and in it:
PS D:\Projects> ls Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 2012-10-22 11:25 superbigle d---- 2012-10-22 14:02 szywon
then you'll have
http://szywon.local:4000 vhosts configured.
dirvhost automatically watches for changes in that directory.
dirvhost works best if you have this line in your
If your operating system doesn't support wild cards in
hosts file (as on Windows) I recommend using local DNS proxy like Acrylic. Otherwise you have to add each host manually. (On Windows it's usually
Installation & Usage
Needs NodeJS. It's best served as a globally visible script, so install it with
-g (on Windows that doesn't require administrator rights):
npm install -g dirvhost
dirvhost command by default uses current directory and port 4000. It can be easily changed using two optional arguments:
dirvhost [dir_name [port]]