Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# app.py
|
2 |
+
import streamlit as st
|
3 |
+
from fastapi import FastAPI
|
4 |
+
import uvicorn
|
5 |
+
from api import app as api_app
|
6 |
+
import threading
|
7 |
+
|
8 |
+
# Your existing Streamlit app code here
|
9 |
+
def run_streamlit():
|
10 |
+
# Your existing Streamlit code...
|
11 |
+
st.title('Instagram Downloader')
|
12 |
+
# ... rest of your Streamlit code ...
|
13 |
+
|
14 |
+
def run_api():
|
15 |
+
uvicorn.run(api_app, host="0.0.0.0", port=8000)
|
16 |
+
|
17 |
+
if __name__ == "__main__":
|
18 |
+
# Run API in a separate thread
|
19 |
+
api_thread = threading.Thread(target=run_api, daemon=True)
|
20 |
+
api_thread.start()
|
21 |
+
|
22 |
+
# Run Streamlit
|
23 |
+
run_streamlit()
|