Class AbstractRouter

java.lang.Object
dev.relism.flash.routing.AbstractRouter
Direct Known Subclasses:
FastPathRouterImpl

public abstract class AbstractRouter extends Object
Base router contract. Owns error handlers and the compile-time middleware wrapping logic. The only concrete implementation is FastPathRouterImpl.

All middleware composition happens once at boot time; the hot-path sees only a plain RequestHandler call with zero allocation overhead.

Default error handlers

  • Dev mode (-Dflash.env=dev): rich HTML pages with full stack traces.
  • Prod mode (default): generic JSON — no internal detail leaked to clients.
Override via FlashApp.onNotFound(dev.relism.flash.models.SimpleHandler.FunctionalHandler) / FlashApp.onException(dev.relism.flash.routing.AbstractRouter.ExceptionHandler).

Registration: use FlashApp — the single public registration API. doRegister(dev.relism.flash.http.HttpMethod, java.lang.String, dev.relism.flash.models.RequestHandler, dev.relism.flash.routing.Middleware[]) is an infrastructure method.