Skip to content

Commit eda3cda

Browse files
committed
Combine two messages in one when starting server.
1 parent e608209 commit eda3cda

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/server/server.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,15 +375,14 @@ func StartServer(listenInterface string, database knowledge.GraphDB,
375375
r.HandleFunc("/api/query", postQueryHandler).Methods("POST")
376376
r.PathPrefix("/").Handler(http.FileServer(http.Dir("./web/build/")))
377377

378-
fmt.Printf("Listening on %s\n", listenInterface)
379-
380378
var err error
381379
if viper.GetString("tls_cert") != "" {
382-
fmt.Println("Server is using TLS, the connection is secure")
380+
fmt.Printf("Listening on %s with TLS enabled, the connection is secure\n", listenInterface)
383381
err = http.ListenAndServeTLS(listenInterface, viper.GetString("tls_cert"),
384382
viper.GetString("tls_key"), r)
385383
} else {
386-
fmt.Println("[WARNING] Server is NOT using TLS, the connection is not secure")
384+
fmt.Printf("[WARNING] Listening on %s with TLS disabled. Use `tls_cert` option to setup a certificate\n",
385+
listenInterface)
387386
err = http.ListenAndServe(listenInterface, r)
388387
}
389388
if err != nil {

0 commit comments

Comments
 (0)