From a2f7a81047516473d15b56dcf24a558c6160e1a1 Mon Sep 17 00:00:00 2001 From: Carson-Shaar <120226019+Carson-Shaar@users.noreply.github.com> Date: Tue, 17 Oct 2023 15:30:28 -0400 Subject: [PATCH] Routing for deployment (#75) * Routing for deployment * version up --- setup.cfg | 2 +- zt_backend/config.py | 2 ++ zt_backend/main.py | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 98a9a500..e6a32af3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ name = zero-true description = A collaborative notebook built for data scientists long_description = file: README.md long_description_content_type = text/markdown -version = 0.0.dev14 +version = 0.0.dev15 [options] include_package_data = true diff --git a/zt_backend/config.py b/zt_backend/config.py index 09f1079c..529588c2 100644 --- a/zt_backend/config.py +++ b/zt_backend/config.py @@ -3,6 +3,8 @@ class Settings(BaseSettings): run_mode: str = "app" + project_name: str = "" + user_name: str = "" @lru_cache() def get_settings(): diff --git a/zt_backend/main.py b/zt_backend/main.py index 8160b9ea..1175d7d1 100644 --- a/zt_backend/main.py +++ b/zt_backend/main.py @@ -5,7 +5,6 @@ from zt_backend.models.notebook import Notebook, CodeCell from zt_backend.config import settings import zt_backend.router as router -import toml import os import uuid @@ -15,11 +14,12 @@ run_mode = settings.run_mode -project_name = '' +project_name = settings.project_name +user_name = settings.user_name route_prefix = '' if project_name: - route_prefix = '/'+project_name+'/'+run_mode + route_prefix = '/'+project_name+'/'+user_name app.include_router(router.router, prefix=route_prefix)