A lightweight, high-performance static file server similar to http-server and serve, but with better performance and no external dependencies. Unlike http-server and serve which require a Node.js environment, this runs directly as a standalone executable binary.
- Fast and lightweight static file server
- Cross-platform support (Windows, macOS, Linux)
- URL prefix support
- CORS enabled by default
- Graceful shutdown
- Zero external dependencies for the binary
- Hot reloading (in progress)
Download the pre-compiled binary from the Releases page.
go install github.com/reedchan7/goserve@maingoserve [options] [directory]
-p <port>: Specify the port to use (default: 3000)-prefix <path>: Add URL prefix to all requests (default: none)
Serve current directory on default port (3000):
goserve
Serve specific directory on port 8080:
goserve -p 8080 ./public
Serve with URL prefix (e.g., http://localhost:3000/app/index.html):
goserve -prefix /app ./public
Combine options:
goserve -p 8080 -prefix /api ./data