code wiki / _hdl_build / nx_dev_api_serve.nx

nx_dev_api_serve.nx

buildroot/runtime/_hdl_build/nx_dev_api_serve.nx

9388 B192 linesdepth 9pulls 15 transitivereach 0 importersview sourcekind servicetopic dev
docsdependenciesstructsconstsfunctions

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

nx_http_server.nx nx_connect.nx nx_dev_api.nx nx_dev_api_serve.nx

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

main dsv_puts da_slen dsv_atoi dsv_serve nx_http_server_addr_loopba nx_http_server_make_sockad nx_http_server_listen sys_ignore_sigpipe sys_mmap sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_close sys_listen dsv_puts ↻ da_cat da_catn sys_mmap ↻ da_catn ↻ nx_http_server_accept_one sys_accept sys_read da_handle da_body_off da_path_is da_slen ↻ da_index da_http_head da_cat ↻ da_cat ↻ da_do_status sys_mmap ↻ da_read_tail sys_openat_rd sys_lseek sys_read ↻ sys_close ↻ da_http_head ↻

structs

none

consts

13const DSV_MAGIC_2048: i64 = 2048
14const DSV_MAGIC_4096: i64 = 4096
16const DSV_PORT_DEFAULT: i64 = 18097
17const DSV_REQ_CAP: i64 = 262144
18const DSV_RESP_CAP: i64 = 524288

functions

20func dsv_puts(s: *u8) -> i64 { sys_write(1, s, da_slen(s)); return 0 }
21func 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
26func dsv_add_content_length(src: *u8, n: i64, dst: *u8) -> i64
called by 1: dsv_serve calls 2: da_catda_catn
41func dsv_serve(port: i64) -> i64
66func dsv_probe(port: i64, path: *u8) -> i64
92func dsv_buildpost(port: i64, organ: *u8) -> i64
132func dsv_runpost(port: i64, organ: *u8) -> i64
169func main(argc: i64, argv: *i64) -> i64