def register_configurations(self): self.application.bind("config.location", "app/config") self.application.bind("config.application", "config.application") self.application.bind("config.mail", "config.mail") self.application.bind("config.session", "config.session") self.application.bind("config.queue", "config.queue") self.application.bind("config.database", "config.database") self.application.bind("config.cache", "config.cache") self.application.bind("config.broadcast", "config.broadcast") self.application.bind("config.auth", "config.auth") self.application.bind("config.filesystem", "config.filesystem") self.application.bind("base_url", "http://localhost:8000") self.application.bind("jobs.location", "app/jobs") self.application.bind("controller.location", "app.controllers") self.application.bind("providers.location", "app/providers") self.application.bind("mailables.location", "app/mailables") self.application.bind("listeners.location", "app/listeners") self.application.bind("validation.location", "app/validation") self.application.bind("server.runner", "masonite.commands.ServeCommand.main") key = load(self.application.make("config.application")).KEY self.application.bind("key", key) self.application.bind("sign", Sign(key))
def register_routes(self): Route.set_controller_locations(self.application.make("controllers.location")) self.application.bind("routes.location", "routes/web") self.application.make("router").add( Route.group( load(self.application.make("routes.location"), "ROUTES"), middleware=["web"] ) )
def register_database(self): from masoniteorm.query import QueryBuilder self.application.bind( "builder", QueryBuilder(connection_details=load( self.application.make("config.database")).DATABASES), ) self.application.bind("migrations.location", "app/databases/migrations") self.application.bind("seeds.location", "app/databases/seeds") from config.database import DB self.application.bind("resolver", DB)