allow cloudflare to be used for zig build
All checks were successful
AWS-Zig Build / build-zig-0.11.0-amd64-host (push) Successful in 1m50s

This commit is contained in:
Emil Lerch 2023-10-20 22:44:30 -07:00
parent 843bc56558
commit e7a6aa5f04
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -12,7 +12,10 @@ const FakeResponse = struct {
},
};
pub const Context = union(enum) {
web_request: if (build_options.build_type == .exe_run) *FakeResponse else *std.http.Server.Response,
web_request: switch (build_options.build_type) {
.exe_run, .cloudflare => *FakeResponse,
else => *std.http.Server.Response,
},
flexilib: struct {
request: flexilib.ZigRequest,
response: flexilib.ZigResponse,