Hacker GitHub

← All repos

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

Mentions per year 5 mentions · busiest year 2023 (5)
20082026
  1. …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...
  2. 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 :=…
  3. 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…
  4. or the go one: $ go run github.com/eliben/static-server@latest
  5. …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...