2023-06-16 23:35:41 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"log"
|
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
|
|
"code.severnaya.net/kordophone-mock/v2/web"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
log.Println("Initializing")
|
|
|
|
|
|
2023-06-18 13:11:51 -07:00
|
|
|
c := web.MockHTTPServerConfiguration{
|
|
|
|
|
AuthEnabled: false,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s := web.NewMockHTTPServer(c)
|
2023-06-16 23:35:41 -07:00
|
|
|
httpServer := &http.Server{
|
|
|
|
|
Addr: ":5738",
|
|
|
|
|
Handler: s,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Populate with test data
|
|
|
|
|
s.Server.PopulateWithTestData()
|
2023-06-19 18:31:05 -07:00
|
|
|
log.Printf("Generated test data. %d conversations", len(s.Server.Conversations()))
|
2023-06-16 23:35:41 -07:00
|
|
|
|
|
|
|
|
log.Fatal(httpServer.ListenAndServe())
|
|
|
|
|
}
|