dingyuliang / prerender-dotnet

prerender.io Middlewares for ASP.NET MVC, ASP.NET Core, IIS
MIT License
13 stars 9 forks source link

DotnetCoreOpen.PrerenderMiddleware #10

Open skommareddi opened 3 years ago

skommareddi commented 3 years ago

I am trying to follow the below step Step 1: Use AddPrerenderConfig() in ConfigurationBuilder

var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) // Prerender Step 1: Add Prerender configuration Json file. .AddPrerenderConfig() .AddEnvironmentVariables();

This looks a bit outdated. I have the below public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; }

Below from program public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => {

                webBuilder.UseStartup<Startup>();
            });
}

What would be the best way to .AddPrerenderConfig()