ApiServer class

API server that automatically registers controllers with annotation support. Now includes JWT validation system integration

Constructors

ApiServer.new({required ServerConfig config, List<Middleware> middleware = const []})

Properties

blacklistedTokensCount int
Obtiene el número de tokens blacklisteados
no setter
config ServerConfig
final
hashCode int
The hash code for this object.
no setterinherited
middleware List<Middleware>
getter/setter pair
pipeline Pipeline
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

blacklistToken(String token) → void
Agrega un token a la blacklist (para logout/revocación)
clearTokenBlacklist() → void
Limpia todos los tokens blacklisteados
configureJWTAuth({required String jwtSecret, List<String> excludePaths = const ['/api/auth', '/api/public', '/health']}) → void
Configura JWT authentication middleware Debe llamarse antes de start() para habilitar validación JWT
disableJWTAuth() → void
Desactiva JWT authentication
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeTokenFromBlacklist(String token) → void
Remueve un token de la blacklist
start({required String host, required int port, required List<BaseController> controllerList, Router? additionalRoutes}) Future<ApiResult<HttpServer>>
Starts the server with automatic controller registration.
stop(HttpServer server) Future<void>
Stops the server gracefully.
toString() String
A string representation of this object.
inherited

Operators

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