Skip to content

Commit

Permalink
feat: configureable developmentserver url
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas H. Kelch committed Sep 18, 2024
1 parent 9915792 commit 40d97cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions deploy/render/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ def _postProcessAppObj(obj):
import logging, requests
from viur.core.render.html.utils import jinjaGlobalFunction
@jinjaGlobalFunction
def inject_vite(render, development: bool | None = None) -> t.Any:
def inject_vite(render, development: bool | None = None, development_server: str = "http://localhost:8081") -> t.Any:
"""build vue imports from manifest"""

if development is None:
try:
resp = requests.get("http://localhost:8081")
resp = requests.get(development_server)
development = resp.status_code == 200
except Exception as e:
development = False

if development:
return """<script type="module" src="http://localhost:8081/@vite/client"></script>
<script type="module" src="http://localhost:8081/main.js"></script>"""
return f"""<script type="module" src="{development_server}/@vite/client"></script>
<script type="module" src="{development_server}/main.js"></script>"""

vite_path = "/static/site"

Expand Down

0 comments on commit 40d97cf

Please sign in to comment.