udemy-go-microservices/broker-service/cmd/api/main.go

29 lines
374 B
Go
Raw Normal View History

2024-08-28 07:28:34 +00:00
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)
}
}