sparky library

@author viniciusddrft Support for doing something awesome. More dartdocs go here.

Classes

AuthJwt
CorsConfig
Configuration for Cross-Origin Resource Sharing (CORS).
Pipeline
A class representing a pipeline of middleware functions.
Response
This class handles responses, with some constructors already configured with request code.
Route
Base class of a route in Sparky; HTTP routes and WebSocket routes extend directly from it.
RouteGroup
Groups multiple routes under a common path prefix.
RouteHttp
HTTP route class, already equipped with constructors to handle Get, Post, Put, Delete Patch, Head, Options, Trace but it's possible to customize and make your route work with more than one method.
RouteWebSocket
WebSocket route class
Sparky
Main logic file of Sparky's operation.
SparkyBase

Enums

AcceptedMethods
Enum with web request methods.
LogConfig
Enum with log configuration.
LogType
Enum with log types.

Mixins

Logs
A mixin that provides logging functionalities for the Sparky server.

Extensions

RequestTools on HttpRequest

Typedefs

Middleware = Future<Response> Function(HttpRequest request)
In this file, there are all types used in Sparky. Normal middleware that receives an HttpRequest and returns a Future<Response>.
MiddlewareNulable = Future<Response?> Function(HttpRequest request)
Nullable middleware that receives an HttpRequest and returns a Future<Response?>.
MiddlewareWebSocket = Future<void> Function(WebSocket webSocket)
WebSocket middleware that receives a WebSocket and returns void.

Exceptions / Errors

ErrorRouteEmpty
Error thrown when Sparky is initialized with an empty set of routes.
RoutesRepeated
Error thrown when duplicate route names are detected during Sparky initialization.
SparkyError
Base class for all internal Sparky errors.
SparkyUnexpectedError
An unexpected error that occurs after duplicate route validation.