Update app.py
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788from fastapi import FastAPIimport randomfrom datetime import datetimeimport platformapp = FastAPI(title="The-Chef's Epic API",description="A seriously cool API with multiple endpoints",version="2.0.0")COOL_FACTS = ["Honey never spoils. Archaeologists have found 3000-year-old honey that's still edible.","A group of flamingos is called a flamboyance.","Octopuses have three hearts and blue blood.","Bananas are berries, but strawberries are not.","There are more stars in the universe than grains of sand on all Earth's beaches."]QUOTES = ["The only way to do great work is to love what you do.","Innovation distinguishes between a leader and a follower.","The future belongs to those who believe in the beauty of their dreams.","Success is not final, failure is not fatal: courage to continue counts."]@app.get("/")def root():return {"message": "Welcome to The-Chef's Epic API!","version": "2.0.0","endpoints": ["/status - Get system status","/random-fact - Get a cool fact","/motivate - Get motivated","/time - Current time","/hello/{name} - Personalized greeting","/docs - API documentation"],"coolness_level": "Over 9000!"}@app.get("/status")def get_status():return {"status": "ONLINE","api_name": "The-Chef's Epic API","version": "2.0.0","platform": platform.system(),"python_version": platform.python_version(),"message": "Running smooth like butter","coolness_level": "Maximum"}@app.get("/random-fact")def random_fact():return {"fact": random.choice(COOL_FACTS),"category": "Mind Blown","timestamp": datetime.now().isoformat()}@app.get("/motivate")def get_motivation():return {"quote": random.choice(QUOTES),"message": "You got this!","timestamp": datetime.now().isoformat()}@app.get("/time")def get_time():now = datetime.now()return {"current_time": now.isoformat(),"date": now.strftime("%Y-%m-%d"),"time": now.strftime("%H:%M:%S"),"day": now.strftime("%A")}@app.get("/hello/{name}")def greet_user(name: str):greeting = random.choice(["Hey", "Hello", "Hi", "Yo"])return {"message": f"{greeting}, {name}!","status": "You're awesome!","boost": "+100 coolness points"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465from fastapi import FastAPIimport randomfrom datetime import datetimeapp = FastAPI(title="The-Chef's Epic API", version="2.0.0")FACTS = ["Honey never spoils","Octopuses have 3 hearts","Bananas are berries","Venus days are longer than its years"]QUOTES = ["Do great work - Steve Jobs","Innovation distinguishes leaders - Steve Jobs","Believe in your dreams - Eleanor Roosevelt"]@app.get("/")def home():return {"message": "Welcome to The-Chef's Epic API!","endpoints": ["/status", "/fact", "/motivate", "/time", "/hello/{name}", "/docs"],"coolness": "Maximum"}@app.get("/status")def status():return {"status": "ONLINE","api": "The-Chef's Epic API","version": "2.0.0","vibe": "Unstoppable"}@app.get("/fact")def get_fact():return {"fact": random.choice(FACTS), "category": "Cool"}@app.get("/motivate")def motivate():return {"quote": random.choice(QUOTES), "message": "You got this!"}@app.get("/time")def time_now():now = datetime.now()return {"time": now.strftime("%H:%M:%S"),"date": now.strftime("%Y-%m-%d"),"day": now.strftime("%A")}@app.get("/hello/{name}")def hello(name: str):return {"message": f"{random.choice(['Hey', 'Hi', 'Yo'])}, {name}!","boost": "+100 points"}}}}}]]
app.py+32-55