1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00

fix docserver invocation from build.zig

This commit is contained in:
Rene Schallner 2024-04-27 21:07:24 +02:00
parent 209ba1cd98
commit fc7f11a35f
2 changed files with 4 additions and 2 deletions

View file

@ -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_step = b.step("run-docserver", "run the docserver");
const docserver_run = b.addRunArtifact(docserver_exe); 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_run.step);
docserver_run_step.dependOn(docserver_step); docserver_run_step.dependOn(docserver_step);

View file

@ -9,7 +9,7 @@ fn on_request(r: zap.Request) void {
pub fn main() !void { pub fn main() !void {
var args_it = std.process.args(); var args_it = std.process.args();
var port: usize = 8080; 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| { while (args_it.next()) |arg| {
if (std.mem.startsWith(u8, arg, "--port=")) { if (std.mem.startsWith(u8, arg, "--port=")) {
@ -37,6 +37,7 @@ pub fn main() !void {
try listener.listen(); try listener.listen();
std.debug.print("\nServing docs from {s} at 0.0.0.0:{}\n", .{ docs_dir, port }); 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 // start worker threads
zap.start(.{ zap.start(.{