Refactor server to go-sqlite and ginext [WIP]
This commit is contained in:
@@ -12,7 +12,6 @@ func SetBufLogger() {
|
||||
buflogger = &BufferWriter{cw: createConsoleWriter()}
|
||||
log.Logger = createLogger(buflogger)
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
ginext.SuppressGinLogs = true
|
||||
}
|
||||
|
||||
func ClearBufLogger(dump bool) {
|
||||
@@ -23,7 +22,6 @@ func ClearBufLogger(dump bool) {
|
||||
log.Logger = createLogger(createConsoleWriter())
|
||||
buflogger = nil
|
||||
gin.SetMode(gin.TestMode)
|
||||
ginext.SuppressGinLogs = false
|
||||
if !dump {
|
||||
log.Info().Msgf("Suppressed %d logmessages / printf-statements", size)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"blackforestbytes.com/simplecloudnotifier/jobs"
|
||||
"blackforestbytes.com/simplecloudnotifier/logic"
|
||||
"blackforestbytes.com/simplecloudnotifier/push"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/ginext"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -87,7 +88,13 @@ func StartSimpleWebserver(t *testing.T) (*logic.Application, string, func()) {
|
||||
TestFailErr(t, err)
|
||||
}
|
||||
|
||||
ginengine := ginext.NewEngine(scn.Conf)
|
||||
ginengine := ginext.NewEngine(ginext.Options{
|
||||
AllowCors: &scn.Conf.Cors,
|
||||
GinDebug: &scn.Conf.GinDebug,
|
||||
BufferBody: langext.PTrue,
|
||||
Timeout: langext.Ptr(time.Duration(int64(scn.Conf.RequestTimeout) * int64(scn.Conf.RequestMaxRetry))),
|
||||
BuildRequestBindError: logic.BuildGinRequestError,
|
||||
})
|
||||
|
||||
router := api.NewRouter(app)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user