Skip to content

Commit

Permalink
updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zNitche committed Apr 18, 2024
1 parent f747820 commit f5b79e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions lightberry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
from lightberry.core.app_context import AppContext
from lightberry.core.routing.router import Router
from lightberry.core.communication.response import Response
from lightberry.core.communication.file_response import FileResponse
from lightberry.tasks.task_base import TaskBase
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from lightberry import Server, App, AppContext
from lightberry.utils import common_utils, files_utils
import tasks


def create_routers(app):
from routes import api
from routes import core
from routes import api, core

app.add_router(api)
app.add_router(core)
Expand All @@ -15,6 +13,8 @@ def create_app():
app = App()

with AppContext(app):
import tasks

app.add_background_task(tasks.ExampleTask())
create_routers(app)

Expand Down
1 change: 1 addition & 0 deletions routes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from routes.api import api
from routes.core import core

from lightberry import AppContext

current_app = AppContext.get_current_app()
Expand Down

0 comments on commit f5b79e1

Please sign in to comment.