Below we have a minimal example using the standard library wsgiref. You can run it with python main.py:
main.py
fromwsgiref.simple_serverimportmake_serverimportlogfirelogfire.configure()defapp(env,start_response):start_response('200 OK',[('Content-Type','text/html')])return[b"Hello World"]app=logfire.instrument_wsgi(app)withmake_server("",8000,app)ashttpd:print("Serving on port 8000...")# Serve until process is killedhttpd.serve_forever()