Skip to content

Commit

Permalink
fix docserver invocation from build.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
renerocksai committed Apr 27, 2024
1 parent 209ba1c commit fc7f11a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ pub fn build(b: *std.Build) !void {

const docserver_run_step = b.step("run-docserver", "run the docserver");
const docserver_run = b.addRunArtifact(docserver_exe);
docserver_run.addPrefixedDirectoryArg("--docs=", docs_obj.getEmittedBinDirectory());
docserver_run.addPrefixedDirectoryArg("--docs=", docs_obj.getEmittedDocs());

docserver_run_step.dependOn(&docserver_run.step);
docserver_run_step.dependOn(docserver_step);

Expand Down
3 changes: 2 additions & 1 deletion tools/docserver.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn on_request(r: zap.Request) void {
pub fn main() !void {
var args_it = std.process.args();
var port: usize = 8080;
var docs_dir: []const u8 = "zig-out/docs";
var docs_dir: []const u8 = "zig-out/zap";

while (args_it.next()) |arg| {
if (std.mem.startsWith(u8, arg, "--port=")) {
Expand Down Expand Up @@ -37,6 +37,7 @@ pub fn main() !void {
try listener.listen();

std.debug.print("\nServing docs from {s} at 0.0.0.0:{}\n", .{ docs_dir, port });
std.debug.print("\nSee docs at http://localhost:{}\n\n", .{port});

// start worker threads
zap.start(.{
Expand Down

0 comments on commit fc7f11a

Please sign in to comment.