@@ -36,18 +36,29 @@ fn replace_title(app: &App, html: &str) -> String {
3636 html. replace ( "{{TITLE}}" , & title)
3737}
3838
39- #[ get( "/" ) ]
40- async fn index ( app : & State < App > ) -> ( ContentType , String ) {
41- let html = file_or_include_str ! ( "console.html" ) ;
39+ fn render_console ( html : String , app : & State < App > ) -> ( ContentType , String ) {
4240 let html = replace_title ( app, & html) ;
4341 ( ContentType :: HTML , html)
4442}
4543
44+ #[ get( "/" ) ]
45+ async fn index ( app : & State < App > ) -> ( ContentType , String ) {
46+ render_console ( file_or_include_str ! ( "console_v1.html" ) , app)
47+ }
48+
49+ #[ get( "/v1" ) ]
50+ async fn v1 ( app : & State < App > ) -> ( ContentType , String ) {
51+ index ( app) . await
52+ }
53+
4654#[ get( "/beta" ) ]
4755async fn beta ( app : & State < App > ) -> ( ContentType , String ) {
48- let html = file_or_include_str ! ( "console_beta.html" ) ;
49- let html = replace_title ( app, & html) ;
50- ( ContentType :: HTML , html)
56+ index ( app) . await
57+ }
58+
59+ #[ get( "/v0" ) ]
60+ async fn v0 ( app : & State < App > ) -> ( ContentType , String ) {
61+ render_console ( file_or_include_str ! ( "console_v0.html" ) , app)
5162}
5263
5364#[ get( "/res/<path>" ) ]
@@ -171,5 +182,5 @@ fn vm_logs(
171182}
172183
173184pub fn routes ( ) -> Vec < Route > {
174- routes ! [ index, beta, res, vm_logs]
185+ routes ! [ index, v1 , beta, v0 , res, vm_logs]
175186}
0 commit comments