Merge pull request #14 from stappersg/favicon
Added favicon.ico
Diff
src/main.rs | 15 +++++++++++++++
statics/README.md | 5 +++++
statics/favicon.ico | 0
3 files changed, 20 insertions(+)
@@ -92,6 +92,17 @@
.into_boxed_bytes(),
);
let static_favicon = |content: &'static [u8]| {
move || async move {
let mut resp = Response::new(Body::from(content));
resp.headers_mut().insert(
http::header::CONTENT_TYPE,
HeaderValue::from_static("image/x-icon"),
);
resp
}
};
let static_css = |content: &'static [u8]| {
move || async move {
let mut resp = Response::new(Body::from(content));
@@ -114,6 +125,10 @@
)
.route("/highlight.css", get(static_css(css)))
.route("/highlight-dark.css", get(static_css(dark_css)))
.route(
"/favicon.ico",
get(static_favicon(include_bytes!("../statics/favicon.ico"))),
)
.fallback(methods::repo::service)
.layer(layer_fn(LoggingMiddleware))
.layer(Extension(Arc::new(Git::new(syntax_set))))
@@ -1,0 +1,5 @@
Current favicon.ico was retrieved
by `wget https://www.git-scm.com/favicon.ico`
When you have a better favicon.ico for this project
contact us.
Binary files /dev/null and a/statics/favicon.ico differ