使用方法

import web

class UserModel(web.Model):
    username: str
    password: str
    
class Index:
    async def get(self, name):
        return f"Hello, {name}!"
    
if __name__ == '__main__':
    urls = {
        "/{name}", Index,
        "/users", UserModel,
    }
    app = web.Application(urls)
    app.run()

已注销
981 声望48 粉丝

Focus on programming efficiency