eliben/static-server
View on GitHub ↗ ★ 244 Go
A simple, zero-configuration HTTP server CLI for serving static files
5 mentions on Hacker News by 5 people: 0 stories, 5 comments · first 2023-09-16 · latest 2023-09-16
20082026
-
…appears [1] to be a very thin wrapper around go's built in file server from the http package. [1]: https://github.com/eliben/static-server/blob/main/internal/s...
comment by quinnftw · 2023-09-16 · in static-server: an HTTP server in Go for static content -
Indeed, the actual heavy lifting is done by the Go standard library; this line ( https://github.com/eliben/static-server/blob/main/internal/s... ) is where the real magic happens (ignoring the logging middleware): fileHandler :=…
comment by eliben · 2023-09-16 · in static-server: an HTTP server in Go for static content -
This is cool - I didn't know you could have Go one-liners that look like this: go run github.com/eliben/static-server@latest I had to upgrade to Go 1.21 for this to work - I was previously on Go 1.20. "brew upgrade go" worked for me. Looks…
comment by simonw · 2023-09-16 · in static-server: an HTTP server in Go for static content -
or the go one: $ go run github.com/eliben/static-server@latest
comment by parminya · 2023-09-16 · in static-server: an HTTP server in Go for static content -
…people will use this outside your intent. It is the way. At the very least, use a secret token. [0] https://github.com/eliben/static-server/blob/3ce83524ed54298...
comment by gabereiser · 2023-09-16 · in static-server: an HTTP server in Go for static content