zap

blazingly fast backends in zig

MIT License

Stars
2.2K
Committers
31

Bot releases are hidden (Show)

zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.24

Updates

Merged PR #19 thx @edyu !!!

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.24
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.24.tar.gz",
            .hash = "1220f520fcdd4b3adbca918deeb42f512f7ef4a827680eea8af9abc64b90ed7a5e78",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.24
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.24.tar.gz",
            .hash = "1220f520fcdd4b3adbca918deeb42f512f7ef4a827680eea8af9abc64b90ed7a5e78",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.23

Updates

  • zap.Middleware.EndpointHander : use endpoints in your middleware chain
  • zap.SimpleRequest.get/setContext() : used internally, but you can, too set a per-request context now

See the README for more details and examples.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.23
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.23.tar.gz",
            .hash = "1220175a7495f41889208349fedd6a35e96d8e413e5cd23b9b875e40d176bad459e1",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.23
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.23.tar.gz",
            .hash = "1220175a7495f41889208349fedd6a35e96d8e413e5cd23b9b875e40d176bad459e1",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.22

Updates

  • synced to std.json updates. Thx to @edyu for the PR!
  • no more -localhost workaround releases 🥳 since the TLS bug is fixed in zig master!

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.22
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.22.tar.gz",
            .hash = "12204761c4f94997c3bd26f420cf9060541c0c09514370dc129e04b35e58d9f3ae71",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.22
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.22.tar.gz",
            .hash = "12204761c4f94997c3bd26f420cf9060541c0c09514370dc129e04b35e58d9f3ae71",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.21-localhost

This is probably the last localhost release, as 14 hours ago Andrew fixed the bug causing the need for it. Unfortunately, it didn't make it into the last nightly build.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.21-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.21-localhost.tar.gz",
            .hash = "12207c67914fc9f69de6d614df75364e85bc2ebd847a659e8a904981bc7bb125c3cd",
        }
$ # get dependency required by zap
$ wget https://github.com/zigzap/facil.io/archive/refs/tags/zap-0.0.8.tar.gz
$ # get zap itself
$ wget https://github.com/zigzap/zap/archive/refs/tags/release-0.0.21-localhost.tar.gz
$ # start a http server on port 8000
$ python -m http.server 

This hosts the downloaded dependencies locally on port 8000. After the firstzig build, you can stop the python http server with CTRL+C.

From then on, this release of ZAP and its dependency will remain in ZIG's global build cache. So you don't need to start an HTTP server on every build.

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.21-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.21-localhost.tar.gz",
            .hash = "12207c67914fc9f69de6d614df75364e85bc2ebd847a659e8a904981bc7bb125c3cd",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.21

Updates

Middleware support! Check out the readme for more info and pointers.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.21
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.21.tar.gz",
            .hash = "12202384c46e9e2059fb5082c61c42aae2421edff233cb8cecef682114cbbabf7197",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.21
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.21.tar.gz",
            .hash = "12202384c46e9e2059fb5082c61c42aae2421edff233cb8cecef682114cbbabf7197",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.20

Updates

SimpleEndpointListener now uses the on_request callback if no endpoint matches the requested URL. See the updated endpoint example.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.20
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.20.tar.gz",
            .hash = "12200772b594bc50bbdc18b14aa3c7461991a33179f9c254de05eb34d214662971da",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.20
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.20.tar.gz",
            .hash = "12200772b594bc50bbdc18b14aa3c7461991a33179f9c254de05eb34d214662971da",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

Just a quick one: SimpleHttpListener's ListenerSettings define an on_request. If provided, this function will be called if no endpoint was found for an incoming request. The endpoints example has been updated accordingly.

        // zap release-0.0.20-localhost
        .zap = .{
            .url = "http://127.0.0.1/release-0.0.20-localhost.tar.gz",
            .hash = "12204c663be7639e98af40ad738780014b18bcf35efbdb4c701aad51c7dec45abf4d",
        }
$ # get dependency required by zap
$ wget https://github.com/zigzap/facil.io/archive/refs/tags/zap-0.0.8.tar.gz
$ # get zap itself
$ wget https://github.com/zigzap/zap/archive/refs/tags/release-0.0.20-localhost.tar.gz
$ # start a http server on port 8000
$ python -m http.server 

This hosts the downloaded dependencies locally on port 8000. After the firstzig build, you can stop the python http server with CTRL+C.

From then on, this release of ZAP and its dependency will remain in ZIG's global build cache. So you don't need to start an HTTP server on every build.

zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.19-localhost

Latest zig-master has problems handling the recent GitHub redirects to codeload.github.com. My work-around for this is as follows:

Change your build.zig.zon zap dependency to localhost:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.19-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.19-localhost.tar.gz",
            .hash = "12201fe4eca3c4b43245d4268c22e5056b5d1b273e44cc9724f807a43c16b9b7b36f",
        }
    }
}
$ # get dependency required by zap
$ wget https://github.com/zigzap/facil.io/archive/refs/tags/zap-0.0.8.tar.gz
$ # get zap itself
$ wget https://github.com/zigzap/zap/archive/refs/tags/release-0.0.19-localhost.tar.gz
$ # start a http server on port 8000
$ python -m http.server 

This hosts the downloaded dependencies locally on port 8000. After the firstzig build, you can stop the python http server with CTRL+C.

Generic

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.11-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.19-localhost.tar.gz",
            .hash = "12201fe4eca3c4b43245d4268c22e5056b5d1b273e44cc9724f807a43c16b9b7b36f",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.11-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.19-localhost.tar.gz",
            .hash = "12201fe4eca3c4b43245d4268c22e5056b5d1b273e44cc9724f807a43c16b9b7b36f",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.19

Updates

SimpleRequest.sendFile() - see the example mentioned in the README.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.19
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.19.tar.gz",
            .hash = "1220e8618ae2240e22e1e01c3f5f8c95f70291cd5ca98c92bdfb86b01e81a9d0314b",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.19
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.19.tar.gz",
            .hash = "1220e8618ae2240e22e1e01c3f5f8c95f70291cd5ca98c92bdfb86b01e81a9d0314b",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.18

Updates:

Just a little fix in debug-logging. Makes watching the UserPassSessionAuth introduced in the previous release more intuitive.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.18
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.18.tar.gz",
            .hash = "12202080c00d04324721ea58a5120031109165177e89c5612edc74494f2d119b2a78",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.18
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.18.tar.gz",
            .hash = "12202080c00d04324721ea58a5120031109165177e89c5612edc74494f2d119b2a78",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.17

Update

UserPassSession Authentication!!! See the README for a pointer to the example.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.17
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.17.tar.gz",
            .hash = "12204e63afe2c140de953b584f6b0eca26135c072a74de76ea9ff37ad59fc2031d32",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.17
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.17.tar.gz",
            .hash = "12204e63afe2c140de953b584f6b0eca26135c072a74de76ea9ff37ad59fc2031d32",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.16

Updates

  • websockets

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.16
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.16.tar.gz",
            .hash = "12204921426e5cdd4e91be5cd0594efe0aff86409d0db44a31b26e427a6736327c9f",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.16
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.16.tar.gz",
            .hash = "12204921426e5cdd4e91be5cd0594efe0aff86409d0db44a31b26e427a6736327c9f",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.15

Updates

  • cookies, similar to HTTP params in 0.0.14

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.15
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.15.tar.gz",
            .hash = "122023067e213715ef87bee4d9ad9707fda028e2f9c7fbe30c28d635acdf6490a651",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.15
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.15.tar.gz",
            .hash = "122023067e213715ef87bee4d9ad9707fda028e2f9c7fbe30c28d635acdf6490a651",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.14

Updates

Mega update! SimpleHttpRequest got Parameters!

  • parseBody() : parse form params
  • parseQuery() : parse query params
  • getParamCount() : returns number of parsed params
  • parametersToOwnedStrList() : get params as kv pairs of strings
  • parametersToOwnedList() : get params as kv list
  • getParamStr() : get parameter by name

How to use

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.14
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.14.tar.gz",
            .hash = "1220adff3eec2ad33ff97d6fe6ad23d796cc52a7d0e290f3b909847e09362df3e242",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.14
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.14.tar.gz",
            .hash = "1220adff3eec2ad33ff97d6fe6ad23d796cc52a7d0e290f3b909847e09362df3e242",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

ZAP Release release-0.0.13

Update and Fixes

  • Auth Endpoint now calls back with the correct *SimpleEndpoint so that callees' @fieldParentPtr can be used
  • Basic Authenticator now allows Authorization headers in addition to Authentication headers

Usage

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.13
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.13.tar.gz",
            .hash = "1220c4c26d3ed0a6e27ff15d6165cfc648f6209b381e0e6ac06c02f68cf54a4c9fe4",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.13
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.13.tar.gz",
            .hash = "1220c4c26d3ed0a6e27ff15d6165cfc648f6209b381e0e6ac06c02f68cf54a4c9fe4",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap - testing new zig

Published by renerocksai over 1 year ago

ZAP Release release-0.0.12-test

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.12-test
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.12-test.tar.gz",
            .hash = "12201a5586b87c689c5c9f00075e84affc5207b0e2596efab0355025031da148d072",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.12-test
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.12-test.tar.gz",
            .hash = "12201a5586b87c689c5c9f00075e84affc5207b0e2596efab0355025031da148d072",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

ZAP Release release-0.0.11-localhost

Latest zig-master has problems handling the recent GitHub
redirects to codeload.github.com. My work-around for this is as follows:

Change your build.zig.zon zap dependency to localhost:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.11-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.11-localhost.tar.gz",
            .hash = "122072531b7983335abffa3f9e66cc7f3153e4a697d3c332ed3811495eb1c75ab3f0",
        }
    }
}
$ # get dependency required by zap
$ wget https://github.com/zigzap/facil.io/archive/refs/tags/zap-0.0.7.tar.gz
$ # get zap itself
$ wget https://github.com/zigzap/zap/archive/refs/tags/release-0.0.11-localhost.tar.gz
$ # start a http server on port 8000
$ python -m http.server 

This hosts the downloaded dependencies locally on port 8000. After the first
zig build, you can stop the python http server with
CTRL+C.

Generic

To use in your own projects, put this dependency into your build.zig.zon:

        // zap release-0.0.11-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.11-localhost.tar.gz",
            .hash = "122072531b7983335abffa3f9e66cc7f3153e4a697d3c332ed3811495eb1c75ab3f0",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap release-0.0.11-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.11-localhost.tar.gz",
            .hash = "122072531b7983335abffa3f9e66cc7f3153e4a697d3c332ed3811495eb1c75ab3f0",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap - Release 0.0.11

Published by renerocksai over 1 year ago

ZAP Release 0.0.11

To use in your own projects, put this dependency into your build.zig.zon:

        // zap 0.0.11
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.11.tar.gz",
            .hash = "12201e0b2a2a7b034f0dd70326aeb9e23630f802be2d07d2ccede7c9629db0f71737",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap 0.0.11
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.11.tar.gz",
            .hash = "12201e0b2a2a7b034f0dd70326aeb9e23630f802be2d07d2ccede7c9629db0f71737",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap - release-0.0.10

Published by renerocksai over 1 year ago

To use in your own projects, put this dependency into your build.zig.zon:

        // zap 0.0.10
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.10.tar.gz",
            .hash = "122098517b9638fbb6e6935b6c298a4877978c78ddc595c94a887cd581ef301f00e2",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap 0.0.10
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.10.tar.gz",
            .hash = "122098517b9638fbb6e6935b6c298a4877978c78ddc595c94a887cd581ef301f00e2",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));
zap -

Published by renerocksai over 1 year ago

To use in your own projects, put this dependency into your build.zig.zon:

        // zap 0.0.9
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.9.tar.gz",
            .hash = "122037f519825a7fa26fd0be936eb638789b8bf208741ce7aa64e42ea4deefed3529",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap 0.0.9
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.9.tar.gz",
            .hash = "122037f519825a7fa26fd0be936eb638789b8bf208741ce7aa64e42ea4deefed3529",
        }
    }
}

Then, in your build.zig's build function, add the following before
exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));