fully working example

This commit is contained in:
Emil Lerch 2023-09-21 10:06:54 -07:00
parent 9865cb9e2e
commit b1f2e3cd60
Signed by: lobo
GPG Key ID: A7B62D657EF764F8
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
const std = @import("std");
const universal_lambda_build = @import("universal_lambda_build");
const configureUniversalLambdaBuild = @import("universal_lambda_build").configureBuild;
// Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external
@ -25,7 +25,8 @@ pub fn build(b: *std.Build) !void {
.optimize = optimize,
});
try universal_lambda_build.configureBuild(b, exe);
// All modules should be added before this is called
try configureUniversalLambdaBuild(b, exe);
// This declares intent for the executable to be installed into the
// standard location when the user invokes the "install" step (the default

View File

@ -5,9 +5,9 @@ pub fn main() !void {
try universal_lambda.run(null, handler);
}
fn handler(allocator: std.mem.Allocator, event_data: []const u8, context: universal_lambda.Context) ![]const u8 {
_ = allocator;
pub fn handler(allocator: std.mem.Allocator, event_data: []const u8, context: universal_lambda.Context) ![]const u8 {
_ = event_data;
_ = allocator;
_ = context;
return "hello world";
}