Private
Public Access
1
0
This commit is contained in:
James Magahern
2023-06-22 11:06:18 -07:00
parent 84dbb7f006
commit 27de41ddb2
2 changed files with 128 additions and 128 deletions

30
main.go
View File

@@ -3,12 +3,12 @@ package main
import (
"os"
"flag"
"net/http"
"net/http"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"code.severnaya.net/kordophone-mock/v2/web"
"code.severnaya.net/kordophone-mock/v2/web"
)
func main() {
@@ -24,23 +24,23 @@ func main() {
zerolog.SetGlobalLevel(zerolog.DebugLevel)
}
log.Info().Msg("Initializing")
log.Info().Msg("Initializing")
c := web.MockHTTPServerConfiguration{
AuthEnabled: false,
}
c := web.MockHTTPServerConfiguration{
AuthEnabled: false,
}
addr := ":5738"
s := web.NewMockHTTPServer(c)
httpServer := &http.Server{
Addr: addr,
Handler: s,
}
s := web.NewMockHTTPServer(c)
httpServer := &http.Server{
Addr: addr,
Handler: s,
}
// Populate with test data
s.Server.PopulateWithTestData()
log.Info().Msgf("Generated test data. %d conversations", len(s.Server.Conversations()))
// Populate with test data
s.Server.PopulateWithTestData()
log.Info().Msgf("Generated test data. %d conversations", len(s.Server.Conversations()))
log.Info().Msgf("Listening on %s", addr)
log.Fatal().Err(httpServer.ListenAndServe())
log.Fatal().Err(httpServer.ListenAndServe())
}