lean into examples
This commit is contained in:
12
examples/static-content/static-content.go
Normal file
12
examples/static-content/static-content.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import "net/http"
|
||||
|
||||
func main() {
|
||||
handler := http.FileServer(http.Dir("./"))
|
||||
http.ListenAndServe(":5000", handler)
|
||||
}
|
||||
|
||||
// todo: index pages
|
||||
// todo: disable listing
|
||||
// todo: custom 404 handling
|
||||
5
examples/static-content/static-content.sh
Normal file
5
examples/static-content/static-content.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
$ go run static-content.go
|
||||
|
||||
$ curl http://127.0.0.1:5000/
|
||||
$ curl http://127.0.0.1:5000/http-server-static.go
|
||||
$ curl http://127.0.0.1:5000/missing
|
||||
Reference in New Issue
Block a user