StatusApp/server/server.go

20 lines
308 B
Go

2020-04-23 07:42:16 +07:00
package server
import (
"fmt"
"net/http"
"strconv"
)
func apiEndpoints() {
http.HandleFunc("/api/latest", allStatus)
}
func StartServer(port int) {
apiEndpoints()
err := http.ListenAndServe(":"+strconv.Itoa(port), nil)
if err != nil {
fmt.Printf("ListenAndServe returned an error: %v", err)
}
}