27 lines
555 B
Go
27 lines
555 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
lishwist "lishwist/core"
|
|
"lishwist/http/env"
|
|
"lishwist/http/server"
|
|
)
|
|
|
|
func main() {
|
|
err := lishwist.Init(env.Configuration.DatabaseFile)
|
|
if err != nil {
|
|
log.Fatalf("Failed to init Lishwist: %s\n", err)
|
|
}
|
|
|
|
useSecureCookies := !env.Configuration.InDev
|
|
r := server.Create(useSecureCookies)
|
|
|
|
log.Printf("Running at http://127.0.0.1:%s\n", env.Configuration.ServePort)
|
|
err = http.ListenAndServe(":"+env.Configuration.ServePort, r)
|
|
if err != nil {
|
|
log.Fatalln("Failed to listen and server:", err)
|
|
}
|
|
}
|