29 lines
374 B
Go
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)
|
||
|
}
|
||
|
}
|