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