Last active
November 19, 2020 03:34
-
-
Save antklim/fd2d1314beac45fbda67dbd22c8be84d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func Start(address string) error { | |
| mux := http.NewServeMux() | |
| client := &http.Client{} | |
| for route, handler := range Routes(client) { | |
| mux.Handle(route, handler) | |
| } | |
| s := &http.Server{ | |
| Addr: address, | |
| Handler: mux, | |
| ReadTimeout: 10 * time.Second, | |
| WriteTimeout: 10 * time.Second, | |
| MaxHeaderBytes: 1 << 20, | |
| } | |
| log.Printf("calc service is listening at %s", address) | |
| return s.ListenAndServe() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment