21 lines
354 B
Go
21 lines
354 B
Go
|
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)
|
||
|
}
|