Compare commits

...

3 Commits

Author SHA1 Message Date
d082531ca4 Bump version number
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2019-05-13 22:02:14 +02:00
0a58a75cd1 Serve favicon
All checks were successful
continuous-integration/drone/push Build is passing
2019-05-13 21:58:07 +02:00
a7441f79cb Add favicon 2019-05-13 21:57:47 +02:00
4 changed files with 9 additions and 2 deletions

2
Cargo.lock generated
View File

@ -791,7 +791,7 @@ dependencies = [
[[package]]
name = "hoc"
version = "0.3.0"
version = "0.4.0"
dependencies = [
"actix-web 1.0.0-beta.2 (registry+https://github.com/rust-lang/crates.io-index)",
"badge 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -1,6 +1,6 @@
[package]
name = "hoc"
version = "0.3.0"
version = "0.4.0"
authors = ["Valentin Brandl <vbrandl@riseup.net>"]
edition = "2018"
build = "build.rs"

View File

@ -81,6 +81,7 @@ struct State {
}
const CSS: &str = include_str!("../static/tacit-css.min.css");
const FAVICON: &[u8] = include_bytes!("../static/favicon32.png");
#[derive(StructOpt, Debug)]
struct Opt {
@ -356,6 +357,11 @@ fn css() -> HttpResponse {
HttpResponse::Ok().content_type("text/css").body(CSS)
}
#[get("/favicon.ico")]
fn favicon32() -> HttpResponse {
HttpResponse::Ok().content_type("image/png").body(FAVICON)
}
fn main() -> std::io::Result<()> {
std::env::set_var("RUST_LOG", "actix_web=info,hoc=info");
pretty_env_logger::init();
@ -371,6 +377,7 @@ fn main() -> std::io::Result<()> {
.wrap(middleware::Logger::default())
.service(index)
.service(css)
.service(favicon32)
.service(generate)
.service(web::resource("/github/{user}/{repo}").to(calculate_hoc::<GitHub>))
.service(web::resource("/gitlab/{user}/{repo}").to(calculate_hoc::<Gitlab>))

BIN
static/favicon32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B