KestrunResponse.WriteHtmlResponseFromFileAsync method

Asynchronously reads an HTML file, merges in placeholders from the provided dictionary, and writes the result as a response.

public Task WriteHtmlResponseFromFileAsync(string filePath, 
    IReadOnlyDictionary<string, object?> vars, int statusCode = 200)
parameter description
filePath The path to the HTML file to read.
vars A dictionary of variables to replace in the template.
statusCode The HTTP status code for the response.

See Also