diff --git a/build.zig b/build.zig index ff6f368..b75c8b5 100644 --- a/build.zig +++ b/build.zig @@ -1,5 +1,5 @@ const std = @import("std"); -const universal_lambda_build = @import("universal_lambda_build"); +const universal_lambda_build = @import("universal-lambda-zig"); // Although this function looks imperative, note that its job is to // declaratively construct a build graph that will be executed by an external @@ -25,8 +25,13 @@ pub fn build(b: *std.Build) !void { .optimize = optimize, }); + const universal_lambda_zig_dep = b.dependency("universal-lambda-zig", .{ + .target = target, + .optimize = optimize, + }); // All modules should be added before this is called - try universal_lambda_build.configureBuild(b, exe); + try universal_lambda_build.configureBuild(b, exe, universal_lambda_zig_dep); + _ = universal_lambda_build.addImports(b, exe, universal_lambda_zig_dep); // This declares intent for the executable to be installed into the // standard location when the user invokes the "install" step (the default @@ -63,7 +68,8 @@ pub fn build(b: *std.Build) !void { .target = target, .optimize = optimize, }); - _ = try universal_lambda_build.addModules(b, unit_tests); + + _ = universal_lambda_build.addImports(b, unit_tests, universal_lambda_zig_dep); const run_unit_tests = b.addRunArtifact(unit_tests); diff --git a/build.zig.zon b/build.zig.zon index 28e7692..1f16733 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -3,13 +3,15 @@ .version = "0.0.1", .dependencies = .{ - .universal_lambda_build = .{ - .url = "https://git.lerch.org/lobo/universal-lambda-zig/archive/4c987d0959f120acccf18cce342b692231282133.tar.gz", - .hash = "122013ce61767eaf4a099c682172e20a3912245153dc357589d9a62e67feefe9bfc7", + .@"universal-lambda-zig" = .{ + .path = "../universal-lambda-zig/", }, - .flexilib = .{ - .url = "https://git.lerch.org/lobo/flexilib/archive/3d3dab9c792651477932e2b61c9f4794ac694dcb.tar.gz", - .hash = "1220fd7a614fe3c9f6006b630bba528e2ec9dca9c66f5ff10f7e471ad2bdd41b6c89", + .@"univeral-lambda-zig" = .{ + .url = "https://git.lerch.org/lobo/universal-lambda-zig/archive/cf8590e3ee658779fc88465e765a1e17e3a225fa.tar.gz", + .hash = "1220ab108c9252c7101e7bd638b5bf8762b9cf5418f48aca73adcadc223d315f1c5c", }, }, + .paths = .{ + "", + }, } diff --git a/src/main.zig b/src/main.zig index 5c2f2c9..95b2b71 100644 --- a/src/main.zig +++ b/src/main.zig @@ -11,7 +11,7 @@ fn handler(allocator: std.mem.Allocator, event_data: []const u8, context: interf var al = std.ArrayList(u8).init(allocator); var writer = al.writer(); try writer.print("Header data passed to handler (if console, this is args+env vars)\n", .{}); - for (context.request.headers.list.items) |f| { + for (context.request.headers) |f| { try writer.print("\t{s}: {s}\n", .{ f.name, f.value }); } try writer.print("======================================================================\n", .{});