|
cwist
Modern C web framework with libttak runtime
|
(Deprecated) Legacy Emscripten WASM entry points. More...
Go to the source code of this file.
(Deprecated) Legacy Emscripten WASM entry points.
A consumer app compiles against libcwist_wasm.a and expands CWIST_WASM_DEFINE_ENTRY(app_symbol) exactly once, after its routes are registered and before the module is used. It exports:
JS side (via the npm package cwist-wasm): const { createCwist } = require('cwist-wasm'); const handle = createCwist(Module); const res = handle({ method: 'GET', path: '/hello' }); // res.status, res.headers, res.body (Uint8Array)
Build the consumer module with the entry exported and the runtime methods the wrapper needs, e.g.:
emcc -O2 -std=c17 -I./include -I./lib -o app.js my_app.c \ libcwist_wasm.a \ -sEXPORTED_FUNCTIONS=_cwist_wasm_dispatch,_cwist_wasm_free,_malloc,_free \ -sEXPORTED_RUNTIME_METHODS=ccall
Emscripten-only, like typedarray.h: everything is guarded by EMSCRIPTEN and this header is a no-op on native toolchains.
Definition in file wasm_entry.h.