使用方法
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()