title util/cn-fileserver content text fmt **cn-fileserver** serves files from a directory over CNP. It can also list directory contents as a CNM document. section Installation text fmt cn-fileserver requires @@https://golang.org/dl/ Go 1.8 or later@@. Install it with: raw sh go install contnet.org/util/cn-fileserver@latest section Usage text fmt Run it with ``cn-fileserver [OPTIONS]`` Available options: list text fmt ``-dir DIR``: serve files from folder DIR (default ``.``) text fmt ``-listen HOST:PORT``: listen on HOST:PORT (default ``localhost:25454``; port is optional and defaults to 25454) text fmt ``-select SELECTORS``: comma-separated list of enabled selectors (default ``byte,info,cnm`` enables all selectors; ``-select=`` to disable selectors) text fmt File matching rules: list text fmt If the requested path doesn't end with ``/`` but is a folder, it will be redirected to the same path with a slash appended. text fmt If the requested path is a folder that contains a file named ``index.cnm``, that file will be sent as the response. text fmt If the requested path is a file, the file will be sent as the response. text fmt If the requested path with ``.cnm`` appended is a file, that file will be sent as the response. text fmt Otherwise the requested path does not exist and an ``error`` response is sent. text fmt For example: ``cn-fileserver -listen 0.0.0.0 -dir /var/contnet/cnroot`` A sample systemd service unit file is also provided with the source code. section Source text fmt The cn-fileserver source code is available on @@https://git.clsr.net/contnet/cn-fileserver@@ links /spec/ Specifications /doc/ Documents /draft/ Drafts /lib/ Libraries /util/ Tools and utilities site tool cn-fileserver