A web server for local development. Inspired by webfs.
serving the current folder
$ webdevn
serving a specific folder on a specific port
$ webdevn -d:./path/to/some/dir -p:54321
serving the current folder with an index file not named index.html
$ webdevn -i:custom_index.html
$ webdevn -h
webdevn - source lang: nim
package manager: nimble
binary version: 0.0.0
Usage:
webdevn [OPTION]
OPTION[-SHORT:, --LONG]:
What to serve:
[-d:PATH, --dir PATH]: Location of the base folder from which to find requested files
[-i:FILENAME, --index FILENAME]: Name (with ext) of the file served when a directory is requested
How to serve:
[-p:PORT, --port PORT]: Number for which port to listen for requests on
[-z, --zero]: Use the any address 0.0.0.0 (instead of explicit localhost)
How to yap:
[-v, --verbose]: Extra information about the server as it runs will be logged
[-l, --logfile]: Write logs to 'webdevn.log' within -d/--dir
[-f, --forbidlogserve]: Returns 404 for requests of log file
One-off Prints:
[-V, --version]: Current build version
[-h, --help]: This message
DEFAULTS:
PATH: ./
FILENAME: index.html
PORT: 0
For short options like '-d:' be sure to include no space after the colon
Pre-built binaries for supported platforms are available only via GitHub Releases. To verify a download:
Linux/Mac:
Make sure to install shasum and zip if not already installed
# Verify the hash matches contents within "checksums.txt"
$ shasum -a 256 "webdevn.zip"
$ unzip "webdevn.zip"
# Verify the hash matches contents "webdevn.sha256"
$ shasum -a 256 "webdevn"
Windows:
certutil and tar should come with the system
> certutil -hashfile "webdevn.zip" SHA256
:: Verify the hash matches contents within "checksums.txt" then continue
> tar -xf "webdevn.zip"
:: Extract
> certutil -hashfile "webdevn.exe" SHA256
:: Verify the hash matches contents of webdevn.exe.sha256
To generate a binary be sure to have nim installed. Then run the following to compile the code:
$ nim c -d:release --outDir:./ ./source/webdevn.nim
There should now be a webdevn or webdevn.exe in the project root that you can then place somewhere accessible from the PATH.