Skip to main content

sse_handler

Function sse_handler 

Source
pub async fn sse_handler(lr: Data<LiveReload>) -> HttpResponse
Expand description

Actix handler for the SSE endpoint.

Wire it up in your App with:

ⓘ
use actix_web::{web, App};
use webui_dev_server::{livereload, LiveReload};

let lr = LiveReload::new("/__webui/livereload");
let app = App::new()
    .app_data(web::Data::new(lr.clone()))
    .route(lr.endpoint(), web::get().to(livereload::sse_handler));