code wiki / _hdl_build / nx_dev_api_serve.nx
nx_dev_api_serve.nx
buildroot/runtime/_hdl_build/nx_dev_api_serve.nx
about
nx_dev_api_serve.nx -- loopback HTTP server for the sovereign DEV/CI API (nx_dev_api). Composes
nx_http_server + da_handle. ADDITIVE + ISOLATED (a new service on a caller port, touches nothing
existing = never-brick). Once LIVE + reverse-proxied at /api/dev, EVERY build is an HTTP call:
POST https://nishifamily.com/api/dev/build organ=<name> -> {exit, output} (no WSL, no shell)
nx_dev_api_serve serve [port] -- accept-loop
nx_dev_api_serve probe <port> <p> -- sovereign plain-HTTP self-test
⚠ SECURITY: /api/dev executes code server-side -> deploy LOOPBACK-only + behind the auth-gated edge
(mgmt admin), never a raw public route. The charset boundary (da_valid_name) blocks traversal/injection.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_http_server.nxnx_connect.nxnx_dev_api.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const DSV_MAGIC_2048: i64 = 2048 |
| 14 | const DSV_MAGIC_4096: i64 = 4096 |
| 16 | const DSV_PORT_DEFAULT: i64 = 18097 |
| 17 | const DSV_REQ_CAP: i64 = 262144 |
| 18 | const DSV_RESP_CAP: i64 = 524288 |
functions
| 20 | func dsv_puts(s: *u8) -> i64 { sys_write(1, s, da_slen(s)); return 0 } |
| 21 | func dsv_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v } called by 1: main |
| 26 | func dsv_add_content_length(src: *u8, n: i64, dst: *u8) -> i64 |
| 41 | func dsv_serve(port: i64) -> i64 called by 1: main calls 10: nx_http_server_addr_loopbacknx_http_server_listendsv_putsda_catda_catnnx_http_server_accept_one+4 |
| 66 | func dsv_probe(port: i64, path: *u8) -> i64 called by 1: main calls 6: nx_http_server_addr_loopbacksys_socketdsv_putsnx_connect_boundedda_catsys_read |
| 92 | func dsv_buildpost(port: i64, organ: *u8) -> i64 called by 1: main calls 8: nx_http_server_addr_loopbacksys_socketdsv_putsnx_connect_boundedda_catsys_read_file+2 |
| 132 | func dsv_runpost(port: i64, organ: *u8) -> i64 called by 1: main calls 8: nx_http_server_addr_loopbacksys_socketdsv_putsnx_connect_boundedda_catsys_read_file+2 |
| 169 | func main(argc: i64, argv: *i64) -> i64 |