cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Databricks Apps Hosting Backend and Frontend

prajwalpoojary
Visitor

Hello, 

I want to host a webapp whose frontend will be on Streamlit and backend running on FastApi. Currently Databricks app listens to host 0.0.0.0 and port 8000 and my backend is running on host '127.0.0.1' and port 8080(if it's available). I want to understand what the best approach is here to host backend and frontend efficiently?

1 REPLY 1

stbjelcevic
Databricks Employee
Databricks Employee

Hi @prajwalpoojary ,

Given you already have Streamlit on 0.0.0.0:8000 and FastAPI on 127.0.0.1:8080, you can keep that split and do server-side calls from Streamlit to http://127.0.0.1:8080/. Itโ€™s efficient and avoids cross-origin/auth issues. If you later want external clients to call the API, move those endpoints under /api on the public 8000 server and use OAuth tokens.

This blog post walks through setting up a react chat frontend to interact with a FastApi backend.