lithair-cli 0.7.0

CLI tool for scaffolding Lithair projects
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use anyhow::Result;
use bytes::Bytes;
use http_body_util::Full;
use hyper::{Request, Response, body::Incoming};
use lithair_core::app::response;
use std::future::Future;
use std::pin::Pin;

pub fn handler(
    _req: Request<Incoming>,
) -> Pin<Box<dyn Future<Output = Result<Response<Full<Bytes>>>> + Send>> {
    Box::pin(async {
        Ok(response::json(
            http::StatusCode::OK,
            r#"{"status":"ok","service":"{{project_name}}"}"#,
        ))
    })
}