Summary
codedb serve currently hardcodes port 7719 (src/main.zig). This blocks a few reasonable local setups:
- Running multiple codedb instances on one host (one per project)
- Putting the server behind a reverse proxy or dev container that wants a different listen port
- Avoiding collisions when 7719 is already taken by another tool
- Integration tests that want an ephemeral port
Proposal
Read CODEDB_PORT from the environment, parse as u16, fall back to 7719 on absence or parse failure. Zero code-path changes for existing users — the default stays the same.
const port: u16 = blk: {
const raw = cio.posixGetenv("CODEDB_PORT") orelse break :blk 7719;
break :blk std.fmt.parseInt(u16, raw, 10) catch 7719;
};
Scope
src/main.zig — one block inside the cmd == "serve" branch
- Docs note (README /
--help usage) optional but nice
Related
Summary
codedb servecurrently hardcodes port 7719 (src/main.zig). This blocks a few reasonable local setups:Proposal
Read
CODEDB_PORTfrom the environment, parse asu16, fall back to7719on absence or parse failure. Zero code-path changes for existing users — the default stays the same.Scope
src/main.zig— one block inside thecmd == "serve"branch--helpusage) optional but niceRelated
codedb serve --portHTTP endpoint on Zig 0.16 #307 (a configurable port is most useful once the HTTP server is restored, but it's an independent change)