# OSmol: the simplest static Gopher server in OCaml
This is a really small (under 45 SLOC) server for serving static content on the small net, namely Gopher. It was written more like as an exercise on writing simple server applications in OCaml, but actually is powering the author's gopherhole at [hoi.st](gopher://hoi.st) as a single set-and-forget static binary with zero host-side dependencies.
## Building
OSmol is expected to be built using the (POSIX-compatible) Makefile supplied in the repo, which, in turn, requires installing [musl-gcc](https://wiki.musl-libc.org/getting-started.html) and two packages from Opam:
Of course, if you need other options, you can tweak the Makefile or build OSmol with the toolchain of your choice. The only module dependency here is `unix.cmxa` which comes with any OCaml installation.
## Usage
Run `./osmol --help` to see all command-line options. As of now, they are as follows:
-`-p`: the TCP port to listen on. Defaults to 70.
-`-d`: the root directory where your content resides. Defaults to `.` (the current working directory).
-`-i`: the name of the file that must be present in all directories you want to make directly accessible. Without this file, the directory selector cannot be opened. Defaults to `index.map`.
The files whose name is customizable with the `-i` switch usually follow standard Gophermap format.
You can also run Osmol as a daemon, logging its start and other output (not much at the moment), for example, like this: