← 🏠

File Server

File Server is a static file web server, similar to Apache, Nginx, and Mongoose. It aims to be smaller, more performant, and easier to use than the other servers. It also includes functionality for minifying/inlining/pretty-printing several web formats.

Click here to download the zip file containing binaries for the following platforms:

Example 1: Serve current folder locally on port 8000

fs 8000 -l

Then visit http://localhost:8000 in your browser.

Example 2: Bind to all adapters and require login with username "aaron" with password "iscool"

fs 8000 -a "aaron:iscool"

Example 3: Mask autoindex with "index.html" and move autoindex to prefix "/admin/"

fs 8000 -a "aaron:iscool" -p admin

Usage

USAGE:
	fs [port] -l -a [username:password] -p [prefix]
WHERE:
	-[port] is the port
	-if -l is set, the server will listen on localhost only
	-if -a is set, [username:password] are the credentials for basic authentication
	-if -p is set, [prefix] is a path prefix that requires authentication, shows the
	 autoindex, and allows uploads; non-prefixed paths no longer require authentication
	 (if set) and the autoindex is masked by a file named "index.html", or 404 if
	 such a file does not exist
EXTRAS:
	fs ip => print local IPv4 addresses
	fs minify [css|js|json] => minify a .css or .js file
	fs inline [html] => inline a .html file that contains external css or js
	fs render [html] => render a .html file that contains server-side includes
	fs pretty [json] => pretty-print a .json file

What features does this server support?

How is this better than Apache/Nginx/Mongoose?