pub mod channels; pub mod db; pub mod items; use axum::{ Router, extract::State, response::{Html, IntoResponse}, routing::get, }; use clap::{Parser, Subcommand}; use std::error::Error; // use tokio::time::{self, Duration}; use turso::Connection; use crate::channels::{create_channel, get_channels, list_channels}; use crate::items::list_items; #[derive(Parser)] #[command(version, about, long_about = None)] struct Cli { #[command(subcommand)] command: Option, } #[derive(Subcommand)] enum Commands { Reset {}, Refresh {}, } async fn root(State(conn): State) -> impl IntoResponse { let channels: String = get_channels(&conn) .await .unwrap() .iter() .map(|channel| { format!( "
  • {}
  • ", channel.link, channel.title ) }) .collect(); Html(format!( "

    puppycat

    subscribed