Skip to content

A fast, minimalist HTTP server for serving static content.

Notifications You must be signed in to change notification settings

hulloitskai/junior

Repository files navigation

junior

A fast, minimalist HTTP server for serving static content.

Travis CI: build status Go Report Card Docker Hub MicroBadger

Usage

Docker

## Run server listening on port 3000, serving locally from "./local/www".
dk run stevenxie/junior -p 3000:80 -v ./local/www:/www/

Standalone

Download executable from releases, then run:

## Run HTTP server on port 4200, serving from "/var/www".
./junior -p 4200 --root /var/www

## For more details:
./junior --help

Implementation

junior uses valyala/fasthttp behind the scenes to give itself that extra edge, and is bootstrapped with urfave/cli.

The Docker image stevenxie/junior features a version of junior automatically built with Travis and compressed using UPX to keep it extra light.

Purpose

I made junior because I wanted a really fast, lightweight way of running a static site behind the traefik reverse proxy.

I had tried lighttpd, but it proved to be difficult to configure without trailing slashes, and although it was small, it still felt too complicated and bloated for my use case.

So, I set out to build a custom solution, and this is the result of that: