Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
d082531ca4 | |||
0a58a75cd1 | |||
a7441f79cb |
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -791,7 +791,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hoc"
|
name = "hoc"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-web 1.0.0-beta.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"badge 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "hoc"
|
name = "hoc"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
authors = ["Valentin Brandl <vbrandl@riseup.net>"]
|
authors = ["Valentin Brandl <vbrandl@riseup.net>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
@ -81,6 +81,7 @@ struct State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CSS: &str = include_str!("../static/tacit-css.min.css");
|
const CSS: &str = include_str!("../static/tacit-css.min.css");
|
||||||
|
const FAVICON: &[u8] = include_bytes!("../static/favicon32.png");
|
||||||
|
|
||||||
#[derive(StructOpt, Debug)]
|
#[derive(StructOpt, Debug)]
|
||||||
struct Opt {
|
struct Opt {
|
||||||
@ -356,6 +357,11 @@ fn css() -> HttpResponse {
|
|||||||
HttpResponse::Ok().content_type("text/css").body(CSS)
|
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<()> {
|
fn main() -> std::io::Result<()> {
|
||||||
std::env::set_var("RUST_LOG", "actix_web=info,hoc=info");
|
std::env::set_var("RUST_LOG", "actix_web=info,hoc=info");
|
||||||
pretty_env_logger::init();
|
pretty_env_logger::init();
|
||||||
@ -371,6 +377,7 @@ fn main() -> std::io::Result<()> {
|
|||||||
.wrap(middleware::Logger::default())
|
.wrap(middleware::Logger::default())
|
||||||
.service(index)
|
.service(index)
|
||||||
.service(css)
|
.service(css)
|
||||||
|
.service(favicon32)
|
||||||
.service(generate)
|
.service(generate)
|
||||||
.service(web::resource("/github/{user}/{repo}").to(calculate_hoc::<GitHub>))
|
.service(web::resource("/github/{user}/{repo}").to(calculate_hoc::<GitHub>))
|
||||||
.service(web::resource("/gitlab/{user}/{repo}").to(calculate_hoc::<Gitlab>))
|
.service(web::resource("/gitlab/{user}/{repo}").to(calculate_hoc::<Gitlab>))
|
||||||
|
BIN
static/favicon32.png
Normal file
BIN
static/favicon32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 682 B |
Reference in New Issue
Block a user