Spaces:
Sleeping
Sleeping
from fastapi import FastAPI | |
import requests | |
from bs4 import BeautifulSoup | |
import re | |
app = FastAPI(title="Deploying FastAPI Apps on Huggingface") | |
def api_home(): | |
return {'detail': 'Welcome to FastAPI Tutorial!'} | |
def hello(name: str): | |
return {'message': f"hello {name}!"} | |
def scrape(url: str): | |
response = requests.get(url) | |
soup = BeautifulSoup(response.text, "html.parser") | |
return soup.prettify() |