File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ use axum::{
8
8
use std:: path:: PathBuf ;
9
9
use std:: sync:: { Arc , Mutex } ;
10
10
11
+ const TEMPLATE : & str = include_str ! ( "../static/index.html" ) ;
12
+ const PICO_CSS : & str = include_str ! ( "../static/pico.min.css" ) ;
13
+
11
14
#[ derive( Clone ) ]
12
15
pub struct AppState {
13
16
pub config : Arc < Mutex < AppConfig > > ,
@@ -22,7 +25,12 @@ pub fn app(state: Arc<AppState>) -> Router {
22
25
}
23
26
24
27
async fn index ( ) -> impl IntoResponse {
25
- Html ( include_str ! ( "../static/index.html" ) )
28
+ let html = TEMPLATE
29
+ . replace ( "{BUILD_DATE}" , env ! ( "BUILD_DATE" ) )
30
+ . replace ( "{GIT_DATE}" , env ! ( "GIT_DATE" ) )
31
+ . replace ( "{GIT_HASH}" , env ! ( "GIT_HASH" ) )
32
+ . replace ( "{PICO_CSS}" , PICO_CSS ) ;
33
+ Html ( html)
26
34
}
27
35
28
36
async fn get_config ( State ( state) : State < Arc < AppState > > ) -> impl IntoResponse {
You can’t perform that action at this time.
0 commit comments