all repos — nimhttpd @ 71f2dd93dcfa7a5fb1343ad318e95c39f56295c9

A useful static file web server.

Minor fixes.
Fabio Cevasco fabio.cevasco@it.abb.com
Wed, 10 Nov 2021 12:38:47 +0100
commit

71f2dd93dcfa7a5fb1343ad318e95c39f56295c9

parent

613b789d5913fc1d8e16a055d5783d50985ab348

3 files changed, 11 insertions(+), 8 deletions(-)

jump to
M README.mdREADME.md

@@ -1,7 +1,7 @@

-[![Nimble](https://raw.githubusercontent.com/yglukhov/nimble-tag/master/nimble.png)](https://github.com/h3rald/nimhttpd) +[![Nimble](https://raw.githubusercontent.com/yglukhov/nimble-tag/master/nimble.png)](https://nimble.directory/pkg/nimhttpd) -![release](https://img.shields.io/github/release/h3rald/nimhttpd/all.svg) -![license](https://img.shields.io/github/license/h3rald/nimhttpd.svg) +[![Release](https://img.shields.io/github/release/h3rald/nimhttpd.svg)](https://github.com/h3rald/nimhttpd/releases/latest) +[![License](https://img.shields.io/github/license/h3rald/nimhttpd.svg)](https://raw.githubusercontent.com/h3rald/nimhttpd/master/LICENSE) # NimHTTPd

@@ -13,8 +13,8 @@ **nimhttpd** **[** **-p:**_port_ **-t:**_title_ **-a:**_address_ **]** **[** _directory_ **]**

Where: -* _directory_ is the directory to serve (default: current directory). -* _port_ is the port to listen to (default: 1337). If the specified port is +- _directory_ is the directory to serve (default: current directory). +- _port_ is the port to listen to (default: 1337). If the specified port is unavailable, the number will be incremented until an available port is found. -* _address_ is the address to bind to (default: 0.0.0.0). -* _title_ is the title to use when listing the contents of a directory. +- _address_ is the address to bind to (default: 0.0.0.0). +- _title_ is the title to use when listing the contents of a directory.
M src/nimhttpd.nimsrc/nimhttpd.nim

@@ -96,7 +96,7 @@ var path2 = path

if cwd == "/": return path else: - path2.delete(0, cwd.len-1) + path2.delete(0..cwd.len-1) var relpath = path2.replace("\\", "/") if (not relpath.endsWith("/")) and (not path.fileExists): relpath = relpath&"/"
M src/nimhttpd.nim.cfgsrc/nimhttpd.nim.cfg

@@ -10,3 +10,6 @@ # http://crossgcc.rts-software.org/doku.php?id=compiling_for_linux

amd64.linux.gcc.path = "/usr/local/bin" amd64.linux.gcc.exe = "x86_64-linux-musl-gcc" amd64.linux.gcc.linkerexe = "x86_64-linux-musl-gcc" + +--gc = "orc" +--opt = "size"