mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-10 15:37:28 -06:00
updates to models and tags
This commit is contained in:
parent
32629a378d
commit
f91ba5b304
16 changed files with 290 additions and 70 deletions
|
|
@ -83,7 +83,17 @@ func (r *router) AttachMiddleware(middleware gin.HandlerFunc) {
|
|||
|
||||
// New returns a new Router with the specified configuration, using the given logrus logger.
|
||||
func New(config *config.Config, logger *logrus.Logger) (Router, error) {
|
||||
engine := gin.New()
|
||||
lvl, err := logrus.ParseLevel(config.LogLevel)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("couldn't parse log level %s to set router level: %s", config.LogLevel, err)
|
||||
}
|
||||
switch lvl {
|
||||
case logrus.TraceLevel, logrus.DebugLevel:
|
||||
gin.SetMode(gin.DebugMode)
|
||||
default:
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
}
|
||||
engine := gin.Default()
|
||||
|
||||
// create a new session store middleware
|
||||
store, err := sessionStore()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue