lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NightOwl888 <...@git.apache.org>
Subject [GitHub] lucenenet issue #209: RFC: LUCENENET-565: Porting of Lucene.Net.Replicator
Date Sun, 23 Jul 2017 14:32:56 GMT
Github user NightOwl888 commented on the issue:

    https://github.com/apache/lucenenet/pull/209
  
    Hi Jens,
    
    Before I give this a proper review, I would like to try to plug this into an AspNetCore
app to see if I can get it to work. Could you provide some instructions to how to plug this
in? 
    
    I would expect there to be an extension method for `IHostingEnvironment` or `IApplicationBuilder`
so it could be added to the application:
    
    ```c#
        public class Startup
        {
            public Startup(IHostingEnvironment env)
            {
                var builder = new ConfigurationBuilder()
                    .SetBasePath(env.ContentRootPath)
                    .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                    .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                    .AddEnvironmentVariables();
                Configuration = builder.Build();
            }
    
            public IConfigurationRoot Configuration { get; }
    
            // This method gets called by the runtime. Use this method to add services to
the container.
            public void ConfigureServices(IServiceCollection services)
            {
                // Add framework services.
                services.AddMvc();
            }
    
            // This method gets called by the runtime. Use this method to configure the HTTP
request pipeline.
            public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory
loggerFactory)
            {
                loggerFactory.AddConsole(Configuration.GetSection("Logging"));
                loggerFactory.AddDebug();
    
                app.UseMvc();
            }
        }
    ```
    
    For example `services.AddLuceneReplicator()` or `app.UseLuceneReplicator()`. I would also
expect it to configure the default routing to act as a server, since out of the box it should
use the same URL scheme as Lucene's replicator.
    
    Maybe what we have here is a lower level bare-bones component which we will also need,
but it feels like the additional steps to get from here to a working app need to be simplified
(or at the very least documented).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message