pull/39/head
Ciro 2022-11-14 16:42:15 -03:00
rodzic 1131aad082
commit 70746cec44
2 zmienionych plików z 4 dodań i 6 usunięć

Wyświetl plik

@ -29,9 +29,7 @@
# Express production recommendations: https://expressjs.com/en/advanced/best-practice-performance.html # Express production recommendations: https://expressjs.com/en/advanced/best-practice-performance.html
# Fastify production recommendations: https://www.fastify.io/docs/latest/Guides/Recommendations/ # Fastify production recommendations: https://www.fastify.io/docs/latest/Guides/Recommendations/
# from socketify import App, sendfile from socketify import App, sendfile
from socketify import App
from helpers.static_aiofile import static_route, sendfile
app = App() app = App()
@ -45,8 +43,8 @@ async def home(res, req):
app.get("/", home) app.get("/", home)
#serve all files in public folder under /* route (you can use any route like /assets) #serve all files in public folder under /* route (you can use any route like /assets)
# app.static("/", "./public") app.static("/", "./public")
static_route(app, "/", "./public")
app.listen(3000, lambda config: print("Listening on port http://localhost:%d now\n" % config.port)) app.listen(3000, lambda config: print("Listening on port http://localhost:%d now\n" % config.port))
app.run() app.run()

Wyświetl plik

@ -1499,7 +1499,7 @@ class App:
def static(self, route, dire1ctory): def static(self, route, directory):
static_route(self, route, directory) static_route(self, route, directory)
return self return self