Skip to main content

Module data_fetch

Module data_fetch 

Source
Expand description

Runtime fetch of build-staged static data.

scripts/web/stage-web-data.sh publishes the repo’s data files (benchmark results, program sources, legal HTML, lexicon) under /data/ next to the app bundle. Native builds compile the same bytes in via include_str!; these helpers are the wasm side of that split, so the data never rides inside the shipped binary.

Functions§

check_served
Whether what came back for a staged /data file is that file. A server with an SPA fallback answers a missing file with the app’s index.html and a 200, so a missing lexicon.json would otherwise surface as a JSON parse error (“expected value at line 1 column 1”) instead of saying the file is not deployed.