Add homepage

This commit is contained in:
Andras Schmelczer 2025-06-08 14:45:24 +01:00
parent c3e2ff13f2
commit 86e158c7c5
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
3 changed files with 18 additions and 0 deletions

View file

@ -6,6 +6,7 @@ mod fetch_document_version;
mod fetch_document_version_content;
mod fetch_latest_document_version;
mod fetch_latest_documents;
mod index;
mod ping;
mod requests;
mod responses;
@ -54,6 +55,7 @@ pub async fn create_server(config_path: Option<OsString>) -> Result<()> {
let app = Router::new()
.nest("/", get_authed_routes(app_state.clone()))
.route("/", get(index::index))
.route("/vaults/:vault_id/ping", get(ping::ping))
.route("/vaults/:vault_id/ws", get(websocket::websocket_handler))
.layer(DefaultBodyLimit::disable())

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>VaultLink</title>
</head>
<body>
<h1>VaultLink server</h1>
</body>
</html>

View file

@ -0,0 +1,7 @@
use axum::response::{Html, IntoResponse};
pub async fn index() -> impl IntoResponse {
const HTML_CONTENT: &str = include_str!("./assets/index.html");
let html_content = HTML_CONTENT;
Html(html_content)
}