code wiki / (root) / nx_fin_serve.nx

nx_fin_serve.nx

buildroot/runtime/nx_fin_serve.nx

5989 B108 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind servicetopic fin
docsdependenciesstructsconstsfunctions

about

nx_fin_serve.nx -- standalone loopback HTTP server for the finance dashboard. Composes nx_http_server (bind/listen/accept, loopback) and serves fin_stack.html as text/html. ADDITIVE + ISOLATED: a NEW service on a caller-chosen port that touches NOTHING existing -> never-brick by construction (mirrors nx_tools_api_serve). Reads the HTML FRESH per request (dual path: fin_stack.html in cwd, else web_assets/fin_stack.html) so a version bump = regenerate + push the HTML, no server redeploy. sites.elf proxies nishifamily.com/finance -> 127.0.0.1:<port> (mode gated = login gate). nx_fin_serve serve [port] -- accept-loop, serve the dashboard nx_fin_serve probe <port> <path> -- sovereign plain-HTTP self-test of the live round-trip license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_http_server.nx nx_connect.nx nx_fin_serve.nx

imports: nx_http_server.nxnx_connect.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main fs_puts fs_slen fs_atoi fs_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 fs_puts ↻ fs_cat fs_catn nx_http_server_accept_one sys_accept sys_read fs_read_html sys_read ↻ fs_response fs_cat ↻ fs_catn ↻ nx_http_server_send_respon sys_write sys_close ↻ fs_probe nx_http_server_addr_loopba ↻ sys_socket ↻ fs_puts ↻ nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll fs_cat ↻

structs

none

consts

12const FS_MAGIC_8192: i64 = 8192
13const FS_MAGIC_4096: i64 = 4096
14const FS_MAGIC_2048: i64 = 2048
16const FS_PORT_DEFAULT: i64 = 18097
17const FS_CAP: i64 = 524288

functions

19func fs_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: fs_puts
20func fs_puts(s: *u8) -> i64 { sys_write(1, s, fs_slen(s)); return 0 }
called by 3: fs_servefs_probemain calls 1: fs_slen
21func fs_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var i: i64 = 0; while s[i] != (0 as u8) { dst[o] = s[i]; o = o + 1; i = i + 1 } return o }
22func fs_catn(dst: *u8, off: i64, v: i64) -> i64
28func fs_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 { return v } if c > 57 { return v } v = v*10 + (c - 48); i = i + 1 } return v }
called by 1: main
31func fs_read_html(html: *u8, cap: i64) -> i64
called by 1: fs_serve calls 1: sys_read
43func fs_response(out: *u8, html: *u8, hn: i64) -> i64
called by 1: fs_serve calls 2: fs_catfs_catn
53func fs_serve(port: i64) -> i64
78func fs_probe(port: i64, path: *u8) -> i64
95func main(argc: i64, argv: *i64) -> i64