FlenxServer class

Servidor SSR pronto do Flenx.

Constructors

FlenxServer({required SeoConfig seo, required RouteRegistry registry, required PageResolver resolvePage, required Component notFound, List<ApiEndpoint> apis = const [], DbExecutor? db, EmailSender? onEmail, TokenVerifier? tokenVerifier, List<StyleRule> styleRules = const [], List<String> rawStyles = const [], List<Component> headExtra = const [], List<Component> floatingButtons = const [], List<String> preloadImages = const [], bool emitHtaccess = true, String lang = 'pt-BR', String flutterBootstrap = 'flutter_bootstrap.js?cb=1'})

Properties

apis List<ApiEndpoint>
final
db DbExecutor?
final
emitHtaccess bool
Gera um .htaccess (Apache/LiteSpeed) no build estático: DirectoryIndex, ErrorDocument 404, redirect www→sem-www, gzip e cache. Ignorado por hosts não-Apache. Desligue com emitHtaccess: false.
final
floatingButtons List<Component>
Botões flutuantes globais (fixos), renderizados ao fim do body de toda página — ex.: FlenxFloatingButton.whatsapp(...).
final
flutterBootstrap String
final
hashCode int
The hash code for this object.
no setterinherited
headExtra List<Component>
Tags extra para o <head> de toda página (ex.: loader de anúncios, scripts de analytics).
final
lang String
final
notFound Component
Componente da página 404.
final
onEmail EmailSender?
final
preloadImages List<String>
Imagens da dobra inicial (LCP) para <link rel="preload" fetchpriority>.
final
rawStyles List<String>
CSS puro (strings) injetado como <style> no <head>.
final
registry RouteRegistry
final
resolvePage PageResolver
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seo SeoConfig
final
styleRules List<StyleRule>
Regras de estilo tipadas (somadas ao reset padrão).
final
tokenVerifier TokenVerifier?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start({int? port}) Future<HttpServer>
Sobe o servidor. Se port for nulo, usa a variável de ambiente PORT (definida pelo jaspr serve/jaspr build) ou 8080.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited