nx_fin_serve.nx
buildroot/runtime/nx_fin_serve.nx
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
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
structs
| none |
consts
| 12 | const FS_MAGIC_8192: i64 = 8192 |
| 13 | const FS_MAGIC_4096: i64 = 4096 |
| 14 | const FS_MAGIC_2048: i64 = 2048 |
| 16 | const FS_PORT_DEFAULT: i64 = 18097 |
| 17 | const FS_CAP: i64 = 524288 |
functions
| 19 | func 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 |
| 20 | func fs_puts(s: *u8) -> i64 { sys_write(1, s, fs_slen(s)); return 0 } |
| 21 | func 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 } |
| 22 | func fs_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 28 | func 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 |
| 31 | func fs_read_html(html: *u8, cap: i64) -> i64 |
| 43 | func fs_response(out: *u8, html: *u8, hn: i64) -> i64 |
| 53 | func fs_serve(port: i64) -> i64 called by 1: main calls 10: nx_http_server_addr_loopbacknx_http_server_listenfs_putsfs_catfs_catnnx_http_server_accept_one+4 |
| 78 | func fs_probe(port: i64, path: *u8) -> i64 called by 1: main calls 7: nx_http_server_addr_loopbacksys_socketfs_putsnx_connect_boundedfs_catsys_read+1 |
| 95 | func main(argc: i64, argv: *i64) -> i64 |