Skip to content

Commit 616b408

Browse files
committed
add info for workbench
1 parent fe134e9 commit 616b408

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

vetiver/server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ def run(self, port: int = 8000, host: str = "127.0.0.1", **kw):
265265
_jupyter_nb()
266266
# check to see if in Posit Workbench, pulled from FastAPI section of user guide
267267
# https://docs.posit.co/ide/server-pro/user/vs-code/guide/proxying-web-servers.html#running-fastapi-with-uvicorn # noqa
268+
path = ""
268269
if "RS_SERVER_URL" in os.environ and os.environ["RS_SERVER_URL"]:
269270
path = (
270271
subprocess.run(
@@ -275,6 +276,9 @@ def run(self, port: int = 8000, host: str = "127.0.0.1", **kw):
275276
.stdout.decode()
276277
.strip()
277278
)
279+
# subprocess is run, new URL given
280+
if len(path) > 0:
281+
print(f"INFO: vetiver running at: {path}")
278282
uvicorn.run(self.app, port=port, host=host, root_path=path, **kw)
279283
else:
280284
uvicorn.run(self.app, port=port, host=host, **kw)

0 commit comments

Comments
 (0)