mirror of
https://github.com/hay-kot/homebox.git
synced 2025-05-30 00:52:29 +00:00
confirm casing
This commit is contained in:
parent
e159087e5f
commit
687282ca68
4 changed files with 54 additions and 17 deletions
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/hay-kot/content/backend/app/api/docs"
|
||||
|
@ -12,7 +11,6 @@ import (
|
|||
"github.com/hay-kot/content/backend/internal/services"
|
||||
"github.com/hay-kot/content/backend/pkgs/server"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
|
@ -27,10 +25,6 @@ import (
|
|||
// @name Authorization
|
||||
// @description "Type 'Bearer TOKEN' to correctly set the API Key"
|
||||
func main() {
|
||||
// Logger Init
|
||||
// zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
||||
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
||||
log.Level(zerolog.DebugLevel)
|
||||
|
||||
cfgFile := "config.yml"
|
||||
|
||||
|
@ -47,8 +41,9 @@ func main() {
|
|||
}
|
||||
|
||||
func run(cfg *config.Config) error {
|
||||
app := NewApp(cfg)
|
||||
app := new(cfg)
|
||||
|
||||
app.setupLogger()
|
||||
// =========================================================================
|
||||
// Initialize Database & Repos
|
||||
|
||||
|
@ -75,20 +70,19 @@ func run(cfg *config.Config) error {
|
|||
|
||||
// =========================================================================
|
||||
// Start Server
|
||||
|
||||
app.conf.Print()
|
||||
|
||||
app.server = server.NewServer(app.conf.Web.Host, app.conf.Web.Port)
|
||||
|
||||
routes := app.newRouter(app.repos)
|
||||
app.LogRoutes(routes)
|
||||
|
||||
if app.conf.Mode != config.ModeDevelopment {
|
||||
app.logRoutes(routes)
|
||||
}
|
||||
|
||||
log.Info().Msgf("Starting HTTP Server on %s:%s", app.server.Host, app.server.Port)
|
||||
|
||||
// =========================================================================
|
||||
// Start Reoccurring Tasks
|
||||
|
||||
go app.StartBgTask(time.Duration(24)*time.Hour, func() {
|
||||
go app.startBgTask(time.Duration(24)*time.Hour, func() {
|
||||
_, err := app.repos.AuthTokens.PurgeExpiredTokens(context.Background())
|
||||
if err != nil {
|
||||
log.Error().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue