static is a simple static web server which does nothing more than just serve up static files with a configured root path
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
James Mills 7d67f8e286
continuous-integration/drone/push Build is passing Details
Fix Drone CI config for building Docker images
2 months ago
.dockerfiles Add capaibility to use go.mills.io/static as a consumable library 3 months ago
.vscode Add support for cgi scripts 2 months ago
cmd/static Add support for cgi scripts 2 months ago
scripts Initial Commit 6 years ago
tools Refactor this project and make it releaseanle 3 years ago
.drone.yml Fix Drone CI config for building Docker images 2 months ago
.gitignore Cleanup 3 months ago
.goreleaser.yml Fix import paths 2 years ago
Dockerfile Add capaibility to use go.mills.io/static as a consumable library 3 months ago
LICENSE Fix license file 5 months ago
Makefile Add capaibility to use go.mills.io/static as a consumable library 3 months ago
README.md Update README 3 months ago
doc.go Add capaibility to use go.mills.io/static as a consumable library 3 months ago
go.mod Add capaibility to use go.mills.io/static as a consumable library 3 months ago
go.sum Add support for cgi scripts 2 months ago
handlers.go Add support for cgi scripts 2 months ago
preflight.sh Add capaibility to use go.mills.io/static as a consumable library 3 months ago
router.go Add capaibility to use go.mills.io/static as a consumable library 3 months ago
server.go Add support for cgi scripts 2 months ago
version.go Add capaibility to use go.mills.io/static as a consumable library 3 months ago

README.md

static - a simple static web server

Build Status Go Report Card Go Reference

static is a simple static web server which does nothing more than just serve up static files with a configured root path. It also supports Single-Page-App (SPA) mode and CORS as well as configurable index files.

Installation

Source

With a valid Go environment:

go install go.mills.io/static/cmd/static@latest

Or build from source:

git clone https://git.mills.io/prologic/static.git
cd static
make install

Usage

Run static:

static

Then visit: http://localhost:8000/

Configuration

By default static services up files from the current directory. This can be configured via the -r/--root option. For a full list of options see --help:

$ ./static -h
Usage: ./static [options] [file]
  -b, --bind string     [int]:<port> to bind to (default "0.0.0.0:8000")
  -d, --debug           enable debug logging
  -i, --index strings   default index file to serve (default [index.html])
  -n, --no-dir          disable directory listing
  -r, --root string     path to serve (default "/Users/prologic/Projects/static")
  -s, --spa             enable single-page (SPA) mode
  -v, --version         display version information
pflag: help requested

License

static is licensed under the terms of the MIC License