feat: HTML default page

This commit is contained in:
Jade Ellis 2025-04-25 02:47:48 +01:00
parent 4158c1cf62
commit e1655edd83
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
14 changed files with 408 additions and 10 deletions

View file

@ -103,6 +103,7 @@ conduwuit-admin.workspace = true
conduwuit-api.workspace = true
conduwuit-core.workspace = true
conduwuit-service.workspace = true
conduwuit-web.workspace = true
const-str.workspace = true
futures.workspace = true
http.workspace = true

View file

@ -1,6 +1,6 @@
use std::sync::Arc;
use axum::{Router, response::IntoResponse, routing::get};
use axum::{Router, response::IntoResponse};
use conduwuit::Error;
use conduwuit_api::router::{state, state::Guard};
use conduwuit_service::Services;
@ -11,7 +11,7 @@ pub(crate) fn build(services: &Arc<Services>) -> (Router, Guard) {
let router = Router::<state::State>::new();
let (state, guard) = state::create(services.clone());
let router = conduwuit_api::router::build(router, &services.server)
.route("/", get(it_works))
.merge(conduwuit_web::build::<state::State>().with_state(()))
.fallback(not_found)
.with_state(state);
@ -21,5 +21,3 @@ pub(crate) fn build(services: &Arc<Services>) -> (Router, Guard) {
async fn not_found(_uri: Uri) -> impl IntoResponse {
Error::Request(ErrorKind::Unrecognized, "Not Found".into(), StatusCode::NOT_FOUND)
}
async fn it_works() -> &'static str { "hewwo from conduwuit woof!" }