Class FlashApp


public final class FlashApp extends FlashRegistrar<FlashApp>
Single entry point for Flash. Owns one flat FastPathRouterImpl — all routes (app-level and scoped) compile into a single FSM at startup.

 FlashApp.create(8080)
     .install(new JacksonExtension())
     .use(cors)
     .get("/ping",    (req, res) -> "pong")
     .get("/secured", (req, res) -> user(), oidc.protect())
     .scan("dev.example.handlers")
     .mount("/api", scope -> scope.get("/health", (req, res) -> "ok"))
     .startAndBlock();   // blocks main thread
 

Startup sequence (both start() and startAndBlock())

  1. All FlashExtension.configure(dev.relism.flash.extension.FlashRegistrar<?>, dev.relism.flash.extension.FlashContext) declarations.
  2. FlashContext.resolveAll() — topo-sort, cycle detection.
  3. Ready callbacks register routes with resolved services.
  4. Compile all routes into one flat FSM — zero prefix scanning at runtime.
  5. Accept loop started.

Default error handlers

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