forked from LukeMathWalker/pavex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.rs
45 lines (35 loc) · 926 Bytes
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use std::path::PathBuf;
use pavex::f;
use pavex::blueprint::router::GET;
use pavex::blueprint::{constructor::Lifecycle, Blueprint};
pub struct Logger;
pub fn extract_path(_inner: &pavex::request::RequestHead) -> PathBuf {
todo!()
}
pub fn logger() -> Logger {
todo!()
}
pub fn stream_file(
_inner: PathBuf,
_logger: Logger,
_http_client: HttpClient,
) -> pavex::response::Response {
todo!()
}
pub struct Config;
pub fn config() -> Config {
todo!()
}
#[derive(Clone)]
pub struct HttpClient;
pub fn http_client(_config: Config) -> HttpClient {
todo!()
}
pub fn app_blueprint() -> Blueprint {
let mut bp = Blueprint::new();
bp.constructor(f!(crate::http_client), Lifecycle::Singleton);
bp.constructor(f!(crate::extract_path), Lifecycle::RequestScoped);
bp.constructor(f!(crate::logger), Lifecycle::Transient);
bp.route(GET, "/home", f!(crate::stream_file));
bp
}