add new argument for allow origins and query without path and only uuid

This commit is contained in:
Adrian Zürcher
2025-05-28 22:05:47 +02:00
parent c57c22f93a
commit 9605b50198
7 changed files with 93 additions and 76 deletions

10
main.go
View File

@@ -23,7 +23,7 @@ func main() {
//initialize new server
dbmHandler.Log.Debug("main", "initialize new server instance")
s := server.NewServer()
s := server.NewServer(a.AllowOrigins)
//set routes
dbmHandler.Log.Debug("main", "setting routes")
@@ -37,16 +37,16 @@ func main() {
// start http server
go func() {
dbmHandler.Log.Info("main", fmt.Sprintf("http listen on %d", a.Port.Http))
if err := s.ServeHttp(a.Port.Http); err != nil {
dbmHandler.Log.Info("main", fmt.Sprintf("http listen on ip: %s port: %d", a.Ip, a.Port.Http))
if err := s.ServeHttp(a.Ip, a.Port.Http); err != nil {
dbmHandler.Log.Error("main", "error http server "+err.Error())
panic(err)
}
}()
// start https server
dbmHandler.Log.Info("main", fmt.Sprintf("https listen on %d", a.Port.Https))
if err := s.ServeHttps(a.Port.Https, a.Cert); err != nil {
dbmHandler.Log.Info("main", fmt.Sprintf("https listen on ip: %s port: %d", a.Ip, a.Port.Https))
if err := s.ServeHttps(a.Ip, a.Port.Https, a.Cert); err != nil {
dbmHandler.Log.Error("main", "error http server "+err.Error())
panic(err)
}