Application-level middleware (CORS, Gzip, rate limit, session, auth) for moonbitstack/moonasgi.
impl Layer for HttpsRedirectfn HttpsRedirect::wrap(_self : HttpsRedirect, app : async (Scope, async () -> Event, async (Event) -> Unit) -> Unit) -> (async (Scope, async () -> Event, async (Event) -> Unit) -> Unit)impl Layer for ProxyHeadersfn ProxyHeaders::wrap(self : ProxyHeaders, app : async (Scope, async () -> Event, async (Event) -> Unit) -> Unit) -> (async (Scope, async () -> Event, async (Event) -> Unit) -> Unit)pub(all) struct RateLimit {
rate : Double
burst : Double
clients : Int
key : (Scope) -> String?
clock : () -> Int64
headers : Bool
name : String
}pub(all) struct ServerErrors {
debug : Bool
handler : (Error) -> (Int, Array[(String, String)], String)?
}impl Layer for ServerErrorsfn ServerErrors::new(debug? : Bool, handler? : (Error) -> (Int, Array[(String, String)], String)) -> ServerErrorsfn ServerErrors::wrap(self : ServerErrors, app : async (Scope, async () -> Event, async (Event) -> Unit) -> Unit) -> (async (Scope, async () -> Event, async (Event) -> Unit) -> Unit)pub(all) struct Sessions {
secret : Bytes
cookie : String
max_age : Int?
path : String
same_site : String
https_only : Bool
domain : String?
clock : () -> Int64
}impl Layer for TrustedHostsfn TrustedHosts::wrap(self : TrustedHosts, app : async (Scope, async () -> Event, async (Event) -> Unit) -> Unit) -> (async (Scope, async () -> Event, async (Event) -> Unit) -> Unit)Install
Download zipApplication-level middleware (CORS, Gzip, rate limit, session, auth) for moonbitstack/moonasgi.