Skip to content

v0.1.0

Choose a tag to compare

@softprops softprops released this 15 Nov 04:58
· 16 commits to main since this release

we have lift off

This initial release includes basic "it works" functionality for hosting zig based aws lambdas. See readme for more information

πŸ“Ό installing

Add the following to your build.zig.zon file to declare a dependency

.{
    .name = "my-first-zig-lambda",
    .version = "0.1.0",
    .dependencies = .{
        // πŸ‘‡ declare dep properties
        .lambda = .{
            // πŸ‘‡ uri to download
            .url = "https://github.com/softprops/zig-lambda-runtime/archive/refs/tags/v0.1.0.tar.gz",
            // πŸ‘‡ hash verification
            .hash = "122084e15b7b04f9023ac9dac6f0a1f341dbf8282aa14f51ff553881be73b624361b",
        }
    }
}

πŸ”§ building

Add the following in your build.zig file

const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});

    const optimize = b.standardOptimizeOption(.{});
    // πŸ‘‡ de-reference lambda dep from build.zig.zon
     const lambda = b.dependency("lambda", .{
        .target = target,
        .optimize = optimize,
    });
    // πŸ‘‡ create an execuable named `bootstrap`. the name `bootstrap` is important
    var exe = b.addExecutable(.{
        .name = "bootstrap",
        .root_source_file = .{ .path = "src/main.zig" },
        .target = target,
        .optimize = optimize,
    });
    // πŸ‘‡ add the lambda module to executable
    exe.addModule("lambda", lambda.module("lambda"));

    b.installArtifact(exe);
}