2fas-server/cmd/admin/main.go
Krzysztof Dryś 2e4f34e829
feat: create admin api (#5)
* feat: create admin api

Create admin api as a standalone application.
2023-09-22 15:19:04 +02:00

26 lines
682 B
Go

package main
import (
"github.com/gin-gonic/gin"
"github.com/twofas/2fas-server/config"
"github.com/twofas/2fas-server/internal/api"
"github.com/twofas/2fas-server/internal/common/http"
"github.com/twofas/2fas-server/internal/common/logging"
)
func main() {
logging.WithDefaultField("service_name", "admin_api")
config.LoadConfiguration()
application := api.NewApplication("admin-api", config.Config)
logging.Infof("Initialize admin-api application: %q", config.Config.App.ListenAddr)
logging.Infof("Environment is: %q", config.Config.Env)
http.RunHttpServer(config.Config.App.ListenAddr, func(engine *gin.Engine) {
application.RegisterAdminRoutes(engine)
})
}