Fixes request being undefined
This commit is contained in:
@@ -18,17 +18,17 @@ async def main():
|
|||||||
server = HTTPServer(pool)
|
server = HTTPServer(pool)
|
||||||
|
|
||||||
@server.route("/")
|
@server.route("/")
|
||||||
def base(_):
|
def base(request: HTTPRequest):
|
||||||
with HTTPResponse(request, content_type=MIMEType.TYPE_HTML) as response:
|
with HTTPResponse(request, content_type=MIMEType.TYPE_HTML) as response:
|
||||||
response.send_file("static/index.html")
|
response.send_file("static/index.html")
|
||||||
|
|
||||||
@server.route("/main.css")
|
@server.route("/main.css")
|
||||||
def css(_):
|
def css(request: HTTPRequest):
|
||||||
with HTTPResponse(request, content_type=MIMEType.TYPE_CSS) as response:
|
with HTTPResponse(request, content_type=MIMEType.TYPE_CSS) as response:
|
||||||
response.send_file("static/main.css")
|
response.send_file("static/main.css")
|
||||||
|
|
||||||
@server.route("/script.js")
|
@server.route("/script.js")
|
||||||
def js(_):
|
def js(request: HTTPRequest):
|
||||||
with HTTPResponse(request, content_type=MIMEType.TYPE_JS) as response:
|
with HTTPResponse(request, content_type=MIMEType.TYPE_JS) as response:
|
||||||
response.send_file("static/script.js")
|
response.send_file("static/script.js")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user