From 71fb5d945eedb67eb285251731796b0e09dc0bc4 Mon Sep 17 00:00:00 2001 From: Ed Yu Date: Wed, 21 Jun 2023 20:44:05 -0700 Subject: [PATCH] Update middleware_with_endpoint example with direct context --- .../middleware_with_endpoint/middleware_with_endpoint.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/middleware_with_endpoint/middleware_with_endpoint.zig b/examples/middleware_with_endpoint/middleware_with_endpoint.zig index f22397f..fe9f0cd 100644 --- a/examples/middleware_with_endpoint/middleware_with_endpoint.zig +++ b/examples/middleware_with_endpoint/middleware_with_endpoint.zig @@ -20,10 +20,10 @@ const SharedAllocator = struct { }; // create a combined context struct -const Context = zap.Middleware.MixContexts(.{ - .{ .name = "?user", .type = UserMiddleWare.User }, - .{ .name = "?session", .type = SessionMiddleWare.Session }, -}); +const Context = struct { + user: ?UserMiddleWare.User = null, + session: ?SessionMiddleWare.Session = null, +}; // we create a Handler type based on our Context const Handler = zap.Middleware.Handler(Context);