Skip to content

Prompt Engineering Forum

A Private Forum For Premium Users

FastAPI and UVICORN...
 
Notifications
Clear all

FastAPI and UVICORN server tip or trick

2 Posts
2 Users
1 Likes
301 Views
SSAdvisor
(@ssadvisor)
Posts: 263
Reputable Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
Points: 1056
Topic starter
 

I discovered, a trick that will make my life easier and I thought I'd share. Put this at the end of your main app file to automate the start of the server when you click the run button in your IDE.

from fastapi import FastAPI
...
app = FastAPI()
...

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app)

 

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
https://calendly.com/seasonedsolutionsadvisor

 
Posted : 31/05/2023 11:59 pm
(@admin)
Posts: 456
Member Admin
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Points: 1130
 

Nice! thanks for sharing

 
Posted : 01/06/2023 7:39 am

Share:
Take Your Digital Marketing Skills To The Next Level

© 2023 LearnWithHasan | All Rights Reserved.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

🔴 New Series Started: Programming With AI - RJP Technique
This is default text for notification bar