I need to create a web HTTP API (it will live behind an nginx proxy, so plain HTTP is fine). I would love to use something like Jetzig – it seems appropriate for my purposes; however, I have been unable to make it run with zig 0.16.
The project’s web page says Jetzig tries to track zig master, but the last update was three months ago. Am I doing something obviously stupid, or has Jetzig not been updated to 0.16? And if the latter, are there any plans to update it?
I don’t know the status of Jetzig, but it uses http.zig behind the scenes, and that project is on 0.16. Maybe you can use http.zig directly if all you need is an http rest api behind a reverse proxy?
Jetzig has some work to do. I’ve followed Jetzig for a while now, and it appears that the original dev stopped working on it around the release of 0.15, and now it’s being worked on by another person sort of on and off. So development seems to be continued, but slowly, and it’s unfortunatly not really usable. The current dev is active on the Jetzig Discord though, and seems to genuinely want to see Jetzig development continue, so hopefully it gets to a usable state again.
EDIT: None of this is hopefully seen as a knock on anyone who is/has worked on Jetzig, there’s a lot of work to be done getting it to 0.16, and I am very appreciative of the work @bobf and @cohors have done on it. Probably wouldn’t be doing much programming, let alone Zig programming, if not for Jetzig and their contributions
Ok, followed the instructions for httpz and am seeing these errors:
❯ zig build run
run
└─ run exe server
└─ compile exe server Debug native 2 errors
error: fatal linker error: unhandled relocation type R_X86_64_PC64 at offset 0x1c
note: in /usr/lib/gcc/x86_64-pc-linux-gnu/15.2.1/../../../../lib/crt1.o:.sframe
error: fatal linker error: unhandled relocation type R_X86_64_PC64 at offset 0x2c
note: in /usr/lib/gcc/x86_64-pc-linux-gnu/15.2.1/../../../../lib/crt1.o:.sframe
error: 2 compilation errors
My system:
OS: Arch Linux x86_64
Kernel: Linux 6.19.13-arch1-1
zig version: 0.16.0
This is my first try with 0.16, so I’m sure I’m holding it wrong. Happy to hear any advice. Cheers!