The URL path or pattern for the route.
-An array of middleware or handler functions to execute for this route.
-The current instance for method chaining.
-Registers a route for HTTP GET requests.
-The URL path or pattern for the route.
-An array of middleware or handler functions to execute for this route.
-The current instance for method chaining.
-Finds and returns the route matching the given path and method.
-The requested path.
-The HTTP method (e.g., "GET").
-The matching route or undefined.
-Registers a new route group with common base path and middleware.
-The base path or RegExp.
-Callback to define routes within the group.
-The Router instance for chaining.
-Registers a route for HTTP HEAD requests.
-The URL path or pattern for the route.
-An array of middleware or handler functions to execute for this route.
-The current instance for method chaining.
-Registers a route for HTTP PATCH requests.
-The URL path or pattern for the route.
-An array of middleware or handler functions to execute for this route.
-The current instance for method chaining.
-Registers a route for HTTP POST requests.
-The URL path or pattern for the route.
-An array of middleware or handler functions to execute for this route.
-The current instance for method chaining.
-Registers a route for HTTP PUT requests.
-The URL path or pattern for the route.
-An array of middleware or handler functions to execute for this route.
-The current instance for method chaining.
-Serves static files from a specified directory.
-Options for serving static files.
-Optional
dir?: stringDirectory containing the static files.
-Optional
route?: RegExpRegular expression to match the route for static files.
-The Router instance for chaining.
-Escapes a string for safe usage in HTML.
-The string to escape.
-The escaped string.
-Iterates over an object or array and applies a callback function.
-The object or array to iterate over.
-The callback function.
-Retrieves the last modification time of a file.
-The file path to check.
-The last modification time in milliseconds.
-Renders a template with the provided data and local variables.
-The name of the template file (without extension).
-Data object to inject into the template.
-Local variables to be used within the template.
-The rendered HTML string.
-Enables or disables the template caching mechanism.
-If true, enables caching.
-Enables or disables debug mode.
-If true, enables debug mode.
-Sets global variables to be used in all templates.
-An object containing global variables.
-Sets the directory for template files and preloads all templates.
-The directory path for template files.
-Starts the HTTP server and begins listening for incoming requests.
-Arguments passed to http.Server.listen
.
Adds a plugin to the application, which can be a Router instance, Tpl instance, -or a middleware handler function. The method determines the type of the plugin -and performs the appropriate action.
-Router
, it is added to the application's router.Tpl
, it sets the application's template engine.The current instance for method chaining.
-
Registers a route for HTTP DELETE requests.
-