mirror of
https://github.com/ThisTine/simple-http-server.git
synced 2026-08-18 23:18:48 +07:00
19 lines
247 B
Go
19 lines
247 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
func main() {
|
|
fs := http.FileServer(http.Dir("./static"))
|
|
http.Handle("/", fs)
|
|
fmt.Print("Listening on 4000")
|
|
err := http.ListenAndServe(":4000", nil)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
}
|