use axum::Router;
use axum::routing::get;
use tracing::info;
use utoipa::OpenApi;

mod assets;
mod betalupi;
mod index;
mod links;

#[derive(OpenApi)]
#[openapi(tags(), paths(), components(schemas()))]
pub(super) struct Api;

pub(super) fn router() -> Router<()> {
	let (asset_prefix, asset_router) = assets::asset_router();
	info!("Serving assets at {asset_prefix}");

	Router::new()
		.route("/", get(index::index))
		.route("/whats-a-betalupi", get(betalupi::betalupi))
		.route("/links", get(links::links))
		.nest(asset_prefix, asset_router)
}
