Skip to content

Commit

Permalink
Routing for deployment (#75)
Browse files Browse the repository at this point in the history
* Routing for deployment

* version up
  • Loading branch information
Carson-Shaar authored Oct 17, 2023
1 parent 03a0e01 commit a2f7a81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions zt_backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

class Settings(BaseSettings):
run_mode: str = "app"
project_name: str = ""
user_name: str = ""

@lru_cache()
def get_settings():
Expand Down
6 changes: 3 additions & 3 deletions zt_backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)

Expand Down

0 comments on commit a2f7a81

Please sign in to comment.