sfx 0.1.2

SFX is a streamlined, full-stack Rust framework for building small web services with integrated authentication, localization, and config-driven UI components
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use hotaru::prelude::*; 
use hotaru::http::*; 

pub fn get_auth_token(req: &mut HttpReqCtx) -> Option<String> {
    let bearer_token = req.meta().get_header("Authorization")?;
    let token_str = bearer_token.strip_prefix("Bearer ")?;
    if token_str.is_empty() {
        None
    } else {
        Some(token_str.to_string())
    }
}