Compare commits
No commits in common. "5e90f3436ad222d9c25bb00911cb66f712e95fc8" and "89c3ee2cfce6d7e57a15851254c2fb209e3f5f33" have entirely different histories.
5e90f3436a
...
89c3ee2cfc
|
|
@ -1,2 +0,0 @@
|
||||||
[env]
|
|
||||||
STATIC_FILE_PATH = { value = "static", relative = true }
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
*.png filter=lfs diff=lfs merge=lfs -text
|
|
||||||
|
|
@ -1,9 +1,3 @@
|
||||||
|
|
||||||
# Emacs
|
|
||||||
*~
|
|
||||||
\#*#
|
|
||||||
.#*
|
|
||||||
|
|
||||||
# ---> Rust
|
# ---> Rust
|
||||||
# Generated by Cargo
|
# Generated by Cargo
|
||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
|
|
|
||||||
13
Cargo.toml
13
Cargo.toml
|
|
@ -1,13 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "localhub"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
tokio = { version = "1", features = ["rt-multi-thread"]}
|
|
||||||
axum = "0.7"
|
|
||||||
askama = "0.12"
|
|
||||||
askama_axum = "0.4"
|
|
||||||
tower-http = { version = "0.5", features = ["fs"] }
|
|
||||||
25
src/main.rs
25
src/main.rs
|
|
@ -1,25 +0,0 @@
|
||||||
use std::env;
|
|
||||||
use askama::Template;
|
|
||||||
use axum::{routing::get, Router};
|
|
||||||
use tower_http::services::ServeDir;
|
|
||||||
|
|
||||||
#[tokio::main]
|
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
||||||
let app = Router::new()
|
|
||||||
.route("/", get(root))
|
|
||||||
.nest_service("/static", ServeDir::new(env::var("STATIC_FILE_PATH")?));
|
|
||||||
|
|
||||||
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await?;
|
|
||||||
axum::serve(listener, app).await?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Template)]
|
|
||||||
#[template(path = "index.html")]
|
|
||||||
struct IndexTemplate<'a> {
|
|
||||||
title: &'a str,
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn root<'a>() -> IndexTemplate<'a> {
|
|
||||||
IndexTemplate { title: "LocalHub" }
|
|
||||||
}
|
|
||||||
BIN
static/favicon-16.png (Stored with Git LFS)
BIN
static/favicon-16.png (Stored with Git LFS)
Binary file not shown.
BIN
static/favicon-167.png (Stored with Git LFS)
BIN
static/favicon-167.png (Stored with Git LFS)
Binary file not shown.
BIN
static/favicon-180.png (Stored with Git LFS)
BIN
static/favicon-180.png (Stored with Git LFS)
Binary file not shown.
BIN
static/favicon-192.png (Stored with Git LFS)
BIN
static/favicon-192.png (Stored with Git LFS)
Binary file not shown.
BIN
static/favicon-32.png (Stored with Git LFS)
BIN
static/favicon-32.png (Stored with Git LFS)
Binary file not shown.
BIN
static/favicon-48.png (Stored with Git LFS)
BIN
static/favicon-48.png (Stored with Git LFS)
Binary file not shown.
|
|
@ -1,21 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en-US">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width" />
|
|
||||||
<title>{{title}}</title>
|
|
||||||
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16.png">
|
|
||||||
<!-- For Google and Android -->
|
|
||||||
<link rel="icon" type="image/png" sizes="48x48" href="static/favicon-48.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="192x192" href="static/favicon-192.png">
|
|
||||||
<!-- For iPad -->
|
|
||||||
<link rel="apple-touch-icon" type="image/png" sizes="167x167" href="static/favicon-167.png">
|
|
||||||
<!-- For iPhone -->
|
|
||||||
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="static/favicon-180.png">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
It still works!
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
Reference in New Issue