Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
from fastapi import FastAPI, Response
|
2 |
import requests
|
3 |
|
4 |
app = FastAPI()
|
@@ -11,10 +10,10 @@ def fetch_html(url: str):
|
|
11 |
}
|
12 |
response = requests.get(url, headers=headers)
|
13 |
response.raise_for_status()
|
14 |
-
return
|
15 |
except requests.RequestException as e:
|
16 |
-
return
|
17 |
|
18 |
if __name__ == "__main__":
|
19 |
import uvicorn
|
20 |
-
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
|
1 |
import requests
|
2 |
|
3 |
app = FastAPI()
|
|
|
10 |
}
|
11 |
response = requests.get(url, headers=headers)
|
12 |
response.raise_for_status()
|
13 |
+
return {"html": response.text}
|
14 |
except requests.RequestException as e:
|
15 |
+
return {"error": str(e)}
|
16 |
|
17 |
if __name__ == "__main__":
|
18 |
import uvicorn
|
19 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|