Skip to content

Commit

Permalink
feat: Changed /first path with /api
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed Oct 3, 2024
1 parent 4e7cd9b commit 24d2896
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion the.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ server {
server {
listen 443;

location /first {
location /api {
proxy_pass http://localhost:3000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
Expand Down
11 changes: 9 additions & 2 deletions upsonic_on_prem/dash/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,22 @@

def the_connection_code(request):
custom_connection_url = os.getenv("custom_connection_url")
use_one = os.environ.get("use_one", "false").lower() == "true"

if custom_connection_url == None:
if custom_connection_url != None:
the_connection_code = f"""from upsonic import UpsonicOnPrem
upsonic = UpsonicOnPrem('{custom_connection_url}', '{request.user.access_key}')
"""
elif custom_connection_url == None and not use_one:
the_connection_code = f"""from upsonic import UpsonicOnPrem
upsonic = UpsonicOnPrem('https://{request.get_host()}:7340', '{request.user.access_key}')
"""
else:
the_connection_code = f"""from upsonic import UpsonicOnPrem
upsonic = UpsonicOnPrem('{custom_connection_url}', '{request.user.access_key}')
upsonic = UpsonicOnPrem('https://{request.get_host()}/api', '{request.user.access_key}')
"""


return the_connection_code


Expand Down

0 comments on commit 24d2896

Please sign in to comment.