Type alias FastHTMLOptions

FastHTMLOptions: {
    file: string;
    ignoredRoutes: RegExp[];
    useAppRoutes: boolean;
}

The options to customize the behavior of the middleware.

Type declaration

  • file: string

    The name of the file the middleware will serve. If the HTMLGenerator service is available, it will be overriden by the service.

    Default

    'index.html'
    
  • ignoredRoutes: RegExp[]

    A list of regular expressions to match request paths that should be ignored by the middleware.

    Default

    [/\.ico$/i]
    
  • useAppRoutes: boolean

    If true, FastHTML will get the list of all the routes controlled by the application, and will use them to validate the incoming requests (in addition to the ignore list): If a request URL doesn't match with any of the "controlled routes", it will serve the HTML file.

    Default

    true
    

Generated using TypeDoc