MicroPie is a small and very fast Python web framework. It is designed with flexability and simplicity in mind. Check out the website or the GitHub project.


from MicroPie import App  

class MyApp(App):  

    async def index(self):  
        return 'Hello ASGI World!'  

app = MyApp()  # Run with `uvicorn app:app`  
  • logging_strict@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 day ago

    What’s the difference between running uvicorn vs nginx?

    Yes could just do a web search, but would like to hear the OP’s perspective

    • harrisonerd@piefed.socialOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      18 hours ago

      Uvicorn and nginx are two completely different things in your web stack. For production, you typically don’t expose Uvicorn directly to the public. Instead, nginx receives all traffic, serves static assets efficiently, and forwards dynamic requests to Uvicorn. Uvicorn’s website explains each components role in your stack: “Using Nginx as a proxy in front of your Uvicorn processes may not be necessary, but is recommended for additional resilience. Nginx can deal with serving your static media and buffering slow requests, leaving your application servers free from load as much as possible. In managed environments such as Heroku, you won’t typically need to configure Nginx, as your server processes will already be running behind load balancing proxies.”

      The question is not “What’s the difference between running uvicorn vs nginx?” But “When should I use Nginx to deploy with Uvicorn?” Hope this makes sense.