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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
use super::super::{NaiveDate, NaiveTime};
use super::model_api;

use rocket::response::content;

pub mod agency;
pub mod db;
pub mod import;
pub mod routes;
pub mod stops;
pub mod stop_times;
pub mod times;
pub mod trips;

#[get("/")]
pub fn main() -> content::Html<String> {
    let mut s: String = String::from(env!("GIT_HASH"));
    s.truncate(7);
    return content::Html(format!(
        r#"<!DOCTYPE html>
    <html>
    <head>
        <title>GTFS API</title>
        <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
        <style>
            body {{
                font-family: 'Open Sans';
            }}
        </style>
    </head>
    <body>
        <h1>GTFS Server</h1>
        <p>
            Commit ({2} - {1}) {0}
        </p>
            <table>
                <tr>
                    <td>
                        GitHub
                    </td>
                    <td>
                        <a href="https://github.com/denysvitali/gtfs-server/commit/{0}">{2}</a>
                    </td>
                </tr>
                <tr>
                    <td>
                        Gogs
                    </td>
                    <td>
                        <a href="https://git.ded1.denv.it/shrug/gtfs-server/commit/{0}">{2}</a>
                    </td>
                </tr>
            </table>
    </body>
    </html>
    "#,
        env!("GIT_HASH"),
        env!("BUILD_DATE"),
        s
    ));
}