2023-01-26 20:58:13 +00:00
|
|
|
package main
|
|
|
|
|
2023-01-26 22:13:44 +00:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2023-01-26 20:58:13 +00:00
|
|
|
func main() {
|
2023-01-26 22:13:44 +00:00
|
|
|
addr := ":80"
|
|
|
|
|
|
|
|
handler()
|
|
|
|
|
|
|
|
err := http.ListenAndServe(addr, nil)
|
|
|
|
|
|
|
|
if errors.Is(err, http.ErrServerClosed) {
|
|
|
|
fmt.Printf("server closed\n")
|
|
|
|
} else if err != nil {
|
|
|
|
fmt.Printf("error starting server: %s\n", err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2023-01-26 20:58:13 +00:00
|
|
|
}
|