-
-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Is really good for DX just use something like:
from socketify import App
app = App()
router = app.router()
@router.get("/")
def home(res, req):
res.end("Hello World!")
api = app.router(prefix="/api")
@api.get("/")
def home(res, req):
res.end("Hello API!")
private = app.router(prefix="/api", token_middleware)
@private.get("/users")
def get_users(res, req, data=None):
res.end("Hello private API!")
app.listen(
3000,
lambda config: print("Listening on port http://localhost:%d now\n" % config.port),
)
app.run()- Create app.router() inspired in Middleware router but using decorators
- Add Documentation
- Optimize for sync middleware with res.run_async
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request