udemy-go-microservices/broker-service/cmd/api/main.go
2024-08-28 09:28:34 +02:00

29 lines
374 B
Go

package main
import (
"fmt"
"log"
"net/http"
)
const webPort = "4000"
type Config struct{}
func main() {
app := Config{}
log.Printf("Starting broker service on port %s\n", webPort)
// define http server
srv := &http.Server{
Addr: fmt.Sprintf(":%s", webPort),
Handler: app.routes(),
}
err := srv.ListenAndServe()
if err != nil {
log.Panic(err)
}
}