Rob02
Rob02
SSolara
Created by Rob02 on 3/26/2024 in #questions-issues
Multiple different solara apps under Fastapi endpoints?
Hi, I can follow the explanation from the docs to integrate one solara app into an existing FastAPI application https://solara.dev/docs/deploying/self-hosted
from fastapi import FastAPI
import solara.server.fastapi

app = FastAPI()


@app.get("/")
def read_root():
return {"Hello": "World"}


app.mount("/solara/", app=solara.server.fastapi.app)
from fastapi import FastAPI
import solara.server.fastapi

app = FastAPI()


@app.get("/")
def read_root():
return {"Hello": "World"}


app.mount("/solara/", app=solara.server.fastapi.app)
and
SOLARA_APP=sol.py uvicorn solara_on_fastapi:app
SOLARA_APP=sol.py uvicorn solara_on_fastapi:app
As this is using one environment variable, i am not sure how to extend this to have two independent solara apps on two different endpoints.eg.
from fastapi import FastAPI
import solara.server.fastapi

app = FastAPI()


@app.get("/")
def read_root():
return {"Hello": "World"}

# with sol1.py
app.mount("/solara1/", app=solara.server.fastapi.app)
# with sol2.py
app.mount("/solara2/", app=solara.server.fastapi.app)
from fastapi import FastAPI
import solara.server.fastapi

app = FastAPI()


@app.get("/")
def read_root():
return {"Hello": "World"}

# with sol1.py
app.mount("/solara1/", app=solara.server.fastapi.app)
# with sol2.py
app.mount("/solara2/", app=solara.server.fastapi.app)
and
SOLARA_APP1=sol1.py SOLARA_APP2=sol2.py uvicorn solara_on_fastapi:app
SOLARA_APP1=sol1.py SOLARA_APP2=sol2.py uvicorn solara_on_fastapi:app
Is there an easy way to do this, maybe by not using a single env variable? Thanks a lot.
4 replies
SSolara
Created by Rob02 on 2/23/2024 in #questions-issues
Ipyreactplayer not working in Solara - New Try
Hi, i've created an interactive videoplayer using ipyreact and reactplayer. It works everywhere (notebook, lab, voila, colab) but not in Solara. Ill want to give it a new shot as Solara is so nice and thats the last part missing in my app. https://github.com/widgetti/solara/issues/333 I tested the player with the same Video on Youtube I updated the Solara and reactplayer versions but i still get the same error
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'Player')
at Vimeo.js:73:32
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'Player')
at Vimeo.js:73:32
Interestingly the code to dynamically load the YT and Vimeo SDKs are almost the same. https://github.com/cookpete/react-player/blob/master/src/players/YouTube.js#L46 https://github.com/cookpete/react-player/blob/master/src/players/Vimeo.js#L31 I am really baffled how this can happen. Do you have any idea where i can have a closer look?
10 replies