Files
maxwarden/cmd/server/main.go
2025-03-11 15:27:28 -04:00

41 lines
721 B
Go

package main
import (
"fmt"
"log"
"net/http"
"maxwarden/config"
"maxwarden/query"
"maxwarden/handlers"
"maxwarden/security"
"maxwarden/tasks"
)
func main() {
fmt.Println("MaxWarden: A simple and secure password manager.")
if config.DEBUG {
fmt.Println("DEBUG BUILD")
} else {
fmt.Println("RELEASE BUILD")
}
config.Init()
security.Init()
query.Init()
handlers.Init()
tasks.Init()
mux := http.NewServeMux()
mapRoutes(mux)
log.Println("Mapped HTTP routes")
log.Println("Listening on http://" + config.GetConfig().Host + ":" + config.GetConfig().Port)
serveErr := http.ListenAndServe(config.GetConfig().Host+":"+config.GetConfig().Port, mux)
if serveErr != nil {
log.Fatal(serveErr)
}
}