mirror of
https://github.com/twofas/2fas-server.git
synced 2024-12-25 18:40:03 +01:00
2e4f34e829
* feat: create admin api Create admin api as a standalone application.
26 lines
682 B
Go
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)
|
|
})
|
|
}
|