Skip to main content

serve_codec

Function serve_codec 

pub async fn serve_codec(
    codec: Arc<dyn Codec>,
    addr: &str,
    opts: CodecOptions,
) -> Result<HttpServer>
Expand description

Serves a codec endpoint for the UI: POST /decode with {"payloads": [base64, ...]} answers {"payloads": [base64 | null, ...]}, each payload passed through codec.decode (null for one it cannot decode). Point the API’s HttpOptions::codec_url at it. The UI’s browser calls it directly, so the keys and the decoded payloads stay with whoever runs it.