SERVEIT is a very simple web server. It serves all files from a specified directory on port 4000. It is intended to be run in a container, hence the almost complete lack of configurability.
To run SERVEIT in its container, mount a directory to serve to /app/web
and publish the container's port 4000
:
docker run <options> \
--volume $PWD/web:/app/web \
--publish 4000:4000 \
gcr.io/o-p-n/serveit:<TAG>
Releases can be found at the serveit
container package. Generally, each release is tagged with its corresponding git commit hash. There is no latest
tag, currently.
The following platforms are supported:
linux/amd64
linux/arm64
SERVEIT can be configuring via environment variables:
Option | Default | Description |
---|---|---|
SERVEIT_ROOT_DIR |
/app/web |
The root directory of files to serve. |
SERVEIT_PORT |
"4000" |
The port to serve on. |
SERVEIT_LOG_LEVEL |
"INFO" |
The level to log at (ALL == everything; OFF == nothing). |
To build serveit
locally, the following tools must be available in your PATH
:
It is possible to obtain most of these (excluding Docker) using an installer script for most of these dependencies (plus others needed by GitHub Actions for publishing and distritubing). By default the script installs tools in ${HOME}/bin
.
In addition, git hooks are managed using Lefthook. It currently has the following hooks:
pre-push
— runs code styling checks (linting and format-checking)This repository uses git modules for some build instructions. Be sure to clone with recursive submodules to have all the necessary files:
git clone --recurse-submodules https://github.com/o-p-n/serveit
Run task test
to execute all unit-tests. Run task cover
to generate code coverage reports (including HTML); coverage reports are stored in ./coverage/html
in your working copy.
Run task image
to build the container image. This is a multi-arch image, with both linux/amd64
and linux/arm64
.