from aiohttp import web async def handle(Request): global Cash headers = {"Access-Control-Allow-Origin": "*"} if Request.path == "/SetValue": Params = Request.rel_url.query CustomAmount = Params.get("customamount") if CustomAmount is not None: try: Cash = int(CustomAmount) except ValueError: return web.Response(text="Invalid amount", headers=headers) return web.Response(text=f"Cash set to: {Cash}", headers=headers) if Request.path == "/GetValue": return web.Response(text=f"Current Cash: {Cash}", headers=headers) if Request.path == "/": html_content = """...your HTML...""" return web.Response(text=html_content, content_type='text/html', headers=headers) return web.Response(text="Invalid endpoint", headers=headers)