Static Files

简介

利用aiohttpStatic file handling能力,可实现静态文件的访问。

示例

app = web.Application()
bridge = Bridge('config.toml', app)
app.router.add_static(prefix='/static/', path='static')
bridge.run_app()

请求:curl -L "http://localhost:8080/static/home.css"
返回(本地的./static/home.css文件内容):

body {
    height: 100%;
}