Skip to content

Probably the fastest (and simplest) way to serve static files.

Notifications You must be signed in to change notification settings

TheDevMinerTV/gostatic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

157 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoStatic

Probably the fastest (and simplest) way to serve static files.

docker run --rm -p 8080:80 -v $PWD:/static:ro ghcr.io/thedevminertv/gostatic

Additionally, you can add the following flags:

-cache <duration> # Enable caching
-compress-level <level> # Enable compression (-1=remove module, 0=none, 2=best)
-log-requests # Log requests (this will slow down the server by ~40%)
-index <file> # The file to serve when the path ends in `/` (default=index.html)
-spa # Make all 404 pages the index file, useful for SPA apps that use client side routing
-download # Enable downloading files
-user <username:password> # Add a user for basic authentication (can be used multiple times)
-users-file <file> # Add a JSON file containing users for basic authentication (JSON takes precedence over command line users)

You can just add these to the end of the docker run command.

About

Probably the fastest (and simplest) way to serve static files.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •