25 lines
336 B
Go
25 lines
336 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"net/http"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
println(len(getEvents()))
|
|
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)
|
|
}
|
|
}
|