Your Not Subscribed My YouTube Channel SubScribe
Posts

How To Add Web Code in Repo

How To Add Web Code in Repo

How To Add Web Code in Repo

WATCH VIDEO

CODE

1) pip install aiohttp


2) add in Local file
from aiohttp import web as webserver

async def bot_run():
    _app = web.Application(client_max_size=30000000)
    _app.add_routes(routes)
    return _app


3) add in local fle
from aiohttp import web as webserver

routes = webserver.RouteTableDef()

@routes.get("/", allow_head=True)
async def root_route_handler(request):
    return webserver.json_response("Mo_Tech_YT")


4) Add in main file
from os import environ
from aiohttp import web as webserver

PORT_CODE = environ.get("PORT", "8080")

client = webserver.AppRunner(await bot_run())

await client.setup()
bind_address = "0.0.0.0"
await webserver.TCPSite(client, bind_address, PORT_CODE).start()


Post a Comment

© Mo Tech. All rights reserved. Distributed by Pixabin