func New(conf DefaultConfiguration) *Dojo {

	logger := logrus.New()
	logger.SetFormatter(&logrus.JSONFormatter{})
	// Output to stdout instead of the default stderr
	// Can be any io.Writer, see below for File example
	logger.SetOutput(os.Stdout)
	// Only log the warning severity or above.
	logger.SetLevel(logrus.DebugLevel)

	cookieStore := sessions.NewCookieStore([]byte(conf.Session.Secret))
	cookieStore.Options.HttpOnly = true
	if conf.App.Environment == "production" {
		cookieStore.Options.Secure = true
	}

	d := &Dojo{
		Configuration:      conf,
		MiddlewareRegistry: NewMiddlewareRegistry(),
		Logger:             logger,
		SessionStore:       cookieStore,
		Debug:              conf.App.Debug,
	}

	d.Auth = NewAuthentication(d)
	d.Route = NewRouter(d)

	return d
}
// New creates a new instance of Application
New creates a new instance of Application
// New creates a new instance of Application
func New(conf DefaultConfiguration) *Dojo {
	logger := logrus.New()
	logger.SetFormatter(&logrus.JSONFormatter{})
	logger.SetOutput(os.Stdout)
	logger.SetLevel(logrus.DebugLevel)
	cookieStore := sessions.NewCookieStore([]byte(conf.Session.Secret))
	cookieStore.Options.HttpOnly = true
	if conf.App.Environment == "production" {
		cookieStore.Options.Secure = true
	}
	d := &Dojo{
		Configuration:      conf,
		MiddlewareRegistry: NewMiddlewareRegistry(),
		Logger:             logger,
		SessionStore:       cookieStore,
		Debug:              conf.App.Debug,
	}
	d.Auth = NewAuthentication(d)
	d.Route = NewRouter(d)
	return d
}
func New ( conf DefaultConfiguration ) * Dojo { logger := logrus . New ( ) logger . SetFormatter ( & logrus . JSONFormatter { } ) logger . SetOutput ( os . Stdout ) logger . SetLevel ( logrus . DebugLevel ) cookieStore := sessions . NewCookieStore ( [ ] byte ( conf . Session . Secret ) ) cookieStore . Options . HttpOnly = true if conf . App . Environment == " " { cookieStore . Options . Secure = true } d := & Dojo { Configuration : conf , MiddlewareRegistry : NewMiddlewareRegistry ( ) , Logger : logger , SessionStore : cookieStore , Debug : conf . App . Debug , } d . Auth = NewAuthentication ( d ) d . Route = NewRouter ( d ) return d }
New creates a new instance of Application
New creates a new instance of Application
// Output to stdout instead of the default stderr // Can be any io.Writer, see below for File example // Only log the warning severity or above.