A simple zero-configuration command-line HTTP files server. Like Python's SimpleHTTPServer but scalable. Сan easily handle thousands of simultaneous connections.
Implemented in Clojure with Aleph and Netty. Mostly as an example. It's still skillful and handy tho'. There's even nothing wrong with putting it to production.
Run in the directory you want to serve:
clj -Sdeps '{:deps {nasus {:mvn/version "0.1.5"}}}' -m http.server
Or specify custom port:
clj -Sdeps '{:deps {nasus {:mvn/version "0.1.5"}}}' -m http.server 8001
In development:
-p, --port <PORT> 8000 Port number
-b, --bind <IP> 0.0.0.0 Address to bind to
--dir <PATH> ./ Directory to serve files
--auth <USER[:PASSWORD]> Basic auth
--no-index Disable directory listings
--no-cache Disable cache headers
--no-compression Disable deflate and gzip compression
--follow-symlink Enable symbolic links support
--include-hidden Process hidden files as normal
--cors Support Acccess-Control-* headers, see --cors-* options for more fine-grained control
--cors-origin Acccess-Control-Allow-Origin response header value
--cors-methods Acccess-Control-Allow-Methods response header value
--cors-allow-headers Acccess-Control-Allow-Headers response header value
-h, --help
Copyright © 2019 Nasus
Nasus is licensed under the MIT license, available at MIT and also in the LICENSE file.
Can you improve this documentation? These fine people already did:
Oleksii Kachaiev, Diogo Silva, r6eve & Martin KlepschEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |