blackhole-bin 0.6.2

blackhole is a server that responds to any request with http status code 200
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use actix_web::{App, HttpServer};
use anyhow::*;
use std::net::SocketAddr;

use crate::middleware::StructuredLogging;

pub async fn serve(addr: SocketAddr) -> Result<()> {
    HttpServer::new(|| App::new().wrap(StructuredLogging))
        .bind(addr)?
        .run()
        .await?;
    Ok(())
}