use crate::fat_error::FatError; use edge_http::io::server::Connection; use edge_nal::io::{Read, Write}; pub(crate) async fn serve_favicon( conn: &mut Connection<'_, T, { N }>, ) -> Result, FatError> where T: Read + Write, { conn.initiate_response(200, Some("OK"), &[("Content-Type", "image/x-icon")]) .await?; conn.write_all(include_bytes!("favicon.ico")).await?; Ok(Some(200)) } pub(crate) async fn serve_index( conn: &mut Connection<'_, T, { N }>, ) -> Result, FatError> where T: Read + Write, { conn.initiate_response( 200, Some("OK"), &[("Content-Type", "text/html"), ("Content-Encoding", "gzip")], ) .await?; conn.write_all(include_bytes!("index.html.gz")).await?; Ok(Some(200)) } pub(crate) async fn serve_bundle( conn: &mut Connection<'_, T, { N }>, ) -> Result, FatError> where T: Read + Write, { conn.initiate_response( 200, Some("OK"), &[ ("Content-Type", "text/javascript"), ("Content-Encoding", "gzip"), ], ) .await?; conn.write_all(include_bytes!("bundle.js.gz")).await?; Ok(Some(200)) }