Files
authorizer/server/main.go

36 lines
1.0 KiB
Go
Raw Permalink Normal View History

package main
import (
"flag"
"github.com/authorizerdev/authorizer/server/constants"
2021-07-28 11:53:37 +05:30
"github.com/authorizerdev/authorizer/server/db"
2021-12-20 17:33:11 +05:30
"github.com/authorizerdev/authorizer/server/env"
2022-01-17 11:32:13 +05:30
"github.com/authorizerdev/authorizer/server/envstore"
2021-07-23 21:57:44 +05:30
"github.com/authorizerdev/authorizer/server/oauth"
2022-01-17 11:32:13 +05:30
"github.com/authorizerdev/authorizer/server/routes"
"github.com/authorizerdev/authorizer/server/sessionstore"
)
2021-12-24 17:47:35 +05:30
var VERSION string
func main() {
envstore.ARG_DB_URL = flag.String("database_url", "", "Database connection string")
envstore.ARG_DB_TYPE = flag.String("database_type", "", "Database type, possible values are postgres,mysql,sqlite")
envstore.ARG_ENV_FILE = flag.String("env_file", "", "Env file path")
flag.Parse()
envstore.EnvInMemoryStoreObj.UpdateEnvVariable(constants.StringStoreIdentifier, constants.EnvKeyVersion, VERSION)
2021-12-24 17:47:35 +05:30
2021-12-20 17:33:11 +05:30
env.InitEnv()
2021-07-28 11:53:37 +05:30
db.InitDB()
2021-12-31 13:52:10 +05:30
env.PersistEnv()
sessionstore.InitSession()
oauth.InitOAuth()
2022-01-17 11:32:13 +05:30
router := routes.InitRouter()
router.Run(":" + envstore.EnvInMemoryStoreObj.GetStringStoreEnvVariable(constants.EnvKeyPort))
}