Spaces:
Running
Running
Commit
·
95dc95a
1
Parent(s):
4cc09a0
Create router.py
Browse files
router.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
from flask import Flask
|
3 |
+
import socket
|
4 |
+
|
5 |
+
app = Flask(__name__)
|
6 |
+
hostname = socket.gethostname()
|
7 |
+
ip_address = socket.gethostbyname(hostname)
|
8 |
+
|
9 |
+
@app.route('/kangas')
|
10 |
+
def kangas():
|
11 |
+
return requests.get(f"http://{ip_address}:7640").content
|
12 |
+
|
13 |
+
@app.route('/')
|
14 |
+
def streamlit():
|
15 |
+
return requests.get(f"http://{ip_address}:7840").content
|