haberdasher-twirp/cmd/main.go

21 lines
354 B
Go
Raw Normal View History

2021-07-26 14:00:25 +00:00
package main
import (
"net/http"
"os"
"haberdasher-twirp/haberdasher"
"haberdasher-twirp/internal/haberdasherserver"
)
func main() {
var bind string = ":8080"
if len(os.Args) > 1 {
bind = os.Args[1]
}
server := &haberdasherserver.Server{}
twirpHandler := haberdasher.NewHaberdasherServer(server)
http.ListenAndServe(bind, twirpHandler)
}