// Create a new milo app.  Uses the config object.
Create a new milo app.  Uses the config object.
// Create a new milo app . Uses the config object .
func NewMiloApp(opts ...func(*Milo) error) *Milo {
	milo := &Milo{
		router:           mux.NewRouter(),
		subRoutes:        make(map[string]*mux.Router),
		logger:           newDefaultLogger(),
		beforeMiddleware: make([]MiloMiddlware, 0),
		afterMiddleware:  make([]MiloMiddlware, 0),
	}
	milo.router.NotFoundHandler = milo
	milo.port = 7000
	for _, opt := range opts {
		err := opt(milo)
		if err != nil {
			milo.logger.LogFatal(err)
		}
	}
	return milo
}
func NewMiloApp ( opts ... func ( * Milo ) error ) * Milo { milo := & Milo { router : mux . NewRouter ( ) , subRoutes : make ( map [ string ] * mux . Router ) , logger : newDefaultLogger ( ) , beforeMiddleware : make ( [ ] MiloMiddlware , 0 ) , afterMiddleware : make ( [ ] MiloMiddlware , 0 ) , } milo . router . NotFoundHandler = milo milo . port = 7000 for _ , opt := range opts { err := opt ( milo ) if err != nil { milo . logger . LogFatal ( err ) } } return milo }
Create a new milo app.
Create a new milo app .