Skip to content

Call with async server #317

@janderadutra

Description

@janderadutra
#[web::get("/hello")]
async fn hello() -> impl web::Responder {

What is the best way to run the scripts?

I only got it with the

let worker = DefaultWorker::new(DefaultWorkerOptions {
        default_entrypoint: None,
        timeout: Duration::from_millis(1000),
        startup_snapshot: Some(SNAPSHOT),
        shared_array_buffer_store: None,
    }).unwrap();

Can it be trait (Clone + Send) to pass to the server?

let server = web::server(move || {
        App::new()
            .state(worker.clone())

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions