kopia lustrzana https://github.com/cirospaciari/socketify.py
fix static
rodzic
1131aad082
commit
70746cec44
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue