main.go 283 B

12345678910111213141516171819
  1. package main
  2. import (
  3. "log"
  4. "net/http"
  5. )
  6. func main() {
  7. // Serve files from the current directory
  8. fs := http.FileServer(http.Dir("."))
  9. http.Handle("/", fs)
  10. log.Println("Listening on :8080...")
  11. err := http.ListenAndServe(":8080", nil)
  12. if err != nil {
  13. log.Fatal(err)
  14. }
  15. }