Improvements.
h3rald h3rald@h3rald.com
Thu, 22 Apr 2021 20:26:25 +0000
3 files changed,
8 insertions(+),
6 deletions(-)
M
README.md
→
README.md
@@ -9,10 +9,12 @@ _NimHTTPd_ is a minimal web server that can be used to serve static files.
## Usage -**nimhttpd** **[** **-p:**_port_ **]** **[** _directory_ **]** +**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 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.
M
src/nimhttpd.nim
→
src/nimhttpd.nim
@@ -130,12 +130,10 @@ var file = path.readFile
return (code: Http200, content: file, headers: {"Content-Type": mimetype}.newHttpHeaders) proc sendDirContents(settings: NimHttpSettings, dir: string): NimHttpResponse = - let cwd = settings.directory + let cwd = settings.directory.absolutePath var res: NimHttpResponse var files = newSeq[string](0) var path = dir.absolutePath - echo path - echo cwd if not path.startsWith(cwd): path = cwd if path != cwd and path != cwd&"/" and path != cwd&"\\":
M
src/style.css
→
src/style.css
@@ -132,10 +132,12 @@ text-decoration: underline;
} @media screen and (max-width: 659px) { a { - font-size: 150%; + font-size: 130%; + line-height: 130%; } li .entypo { - font-size: 150%; + font-size: 130%; + line-height: 130%; } body { width: 100%;