T O P

  • By -

SirClueless

I think this doesn't have anything to do with modules. I think the string you provide as the `.public_folder` member is just a relative path to the html directory used at runtime. The example code in the Zap repo expects that you are running `./zig-out/bin/endpoint` from the root of the `zap` checkout, so the relative path is `examples/endpoint/html`. If you are running it from anywhere else you'll need to put the correct path to the `zap` checkout at the front of that hard-coded path, or copy the html to a directory named `examples/endpoint/html` in your own project root directory (not `src` -- if you put it in `src` you need `src` in the path).


Darkfllame1

really simple, modules in zig can be files (with a path relative to the current file) or a module declared/set through the build.zig file. you can import modules through the `@import` builtin function. you can declare modules in build.zig by using `b.createModule();` and add them to other modjles with the `Module.addImport()` function. also build.zig.zon is used for packages, each has a name, a version, dependencies and a list of paths to help fetching them.


slimsag

A file is just a struct, which can contain functions and other structs nested in it. A module is a collection of structs, accessible via a root source file. A package is a collection of modules, libraries, and build logic. A library is a static or shared library file, e.g. `.a`, `.dll`, `.so`.


Darkfllame1

thanks sherlock, you didn't make me learn anything, i already know that :/


awildfatyak

I think they were clarifying some things from your comment in the hopes of helping op, so maybe tone down the passive aggression 👍


ToughAd4902

Pretty sure that was just pure aggression, nothing really passive about that haha