diff --git a/build.zig b/build.zig index 9cbd45c..c45924d 100644 --- a/build.zig +++ b/build.zig @@ -23,10 +23,15 @@ const api_pkg = std.build.Pkg{ .dependencies = &.{ util_pkg, sql_pkg }, }; +const template_pkg = std.build.Pkg{ + .name = "template", + .source = std.build.FileSource.relative("src/template/lib.zig"), +}; + const main_pkg = std.build.Pkg{ .name = "main", .source = std.build.FileSource.relative("src/main/main.zig"), - .dependencies = &.{ util_pkg, http_pkg, sql_pkg, api_pkg }, + .dependencies = &.{ util_pkg, http_pkg, sql_pkg, api_pkg, template_pkg }, }; pub fn build(b: *std.build.Builder) void { @@ -48,6 +53,7 @@ pub fn build(b: *std.build.Builder) void { exe.addPackage(util_pkg); exe.addPackage(http_pkg); exe.addPackage(api_pkg); + exe.addPackage(template_pkg); exe.linkSystemLibrary("sqlite3"); exe.linkSystemLibrary("pq"); diff --git a/src/http/server.zig b/src/http/server.zig index d81d77a..eaa5a4e 100644 --- a/src/http/server.zig +++ b/src/http/server.zig @@ -44,6 +44,8 @@ pub fn serveConn(conn: std.net.StreamServer.Connection, ctx: anytype, handler: a .stream = conn.stream, }; + std.log.debug("{any}", .{req}); + std.log.debug("Opening handler", .{}); handler(ctx, &req, &res); std.log.debug("done handling", .{}); diff --git a/src/main/controllers/web/index.fmt.html b/src/main/controllers/web/index.tmpl.html similarity index 77% rename from src/main/controllers/web/index.fmt.html rename to src/main/controllers/web/index.tmpl.html index 15b263f..1011070 100644 --- a/src/main/controllers/web/index.fmt.html +++ b/src/main/controllers/web/index.tmpl.html @@ -2,18 +2,17 @@ - {[community_name]s} + { .community.name }
-

{[community_name]s}

- Cluster Admin pseudocommunity +

{ .community.name }

Login