public void ConfigureServices(IServiceCollection services) { //while(!System.Diagnostics.Debugger.IsAttached) System.Threading.Thread.Sleep(10); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" }); }); services.AddMvc(); _bootResult = services.AddDolittle(_loggerFactory); }
/// <summary> /// /// </summary> /// <param name="services"></param> public void ConfigureServices(IServiceCollection services) { services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" }); }); services.AddMvc(); services.AddSentry(_hostingEnvironment, "508c1745-5f2a-4b4c-b7a5-2fbb1484346d", "Studio", "94526bfb-719c-44cd-ad33-cfba77a60c2e"); _bootResult = services.AddDolittle(); }
public void ConfigureServices(IServiceCollection services) { if (_env.IsDevelopment()) { services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" }); }); } services .AddCors() .AddMvc(); services.Configure <ConnectionStringsOptions>(_configuration); _bootResult = services.AddDolittle(_loggerFactory); ConfigureServicesCustom(services); }
public static void Main(string[] arguments) { Thread.CurrentThread.Name = "IHI-EntryThread"; AppDomain.CurrentDomain.UnhandledException += UnhandledException; UnixAware.UnixMode = false; switch (Environment.OSVersion.Platform) { case PlatformID.Unix: case PlatformID.MacOSX: { UnixAware.UnixMode = true; break; } } string configFile = "config.xml"; bool disableAutoExit = false; Regex nameValueRegex = new Regex("^--(?<name>[\\w-]+)=(?<value>.+)$"); foreach (string argument in arguments) { Match nameValueMatch = nameValueRegex.Match(argument); string name = nameValueMatch.Groups["name"].Value; string value = nameValueMatch.Groups["value"].Value; switch (name) { case "config-file": { configFile = value; break; } case "auto-exit": { switch (value.ToLower()) { case "false": case "off": case "no": case "disable": case "disabled": disableAutoExit = true; break; } break; } } } if (!UnixAware.UnixMode) { if (Type.GetType("Mono.Runtime") == null) { Console.Title = "IHI [Windows] [.NET] | V" + Assembly.GetExecutingAssembly().GetName().Version.ToString(4); Console.WriteLine("\n IHI [Windows] [.NET] | V" + Assembly.GetExecutingAssembly().GetName().Version.ToString(4) + "\n"); } else { Console.Title = "IHI [Windows] [Mono] | V" + Assembly.GetExecutingAssembly().GetName().Version.ToString(4); Console.WriteLine("\n IHI [Windows] [Mono] | V" + Assembly.GetExecutingAssembly().GetName().Version.ToString(4) + "\n"); } } else { Console.Title = "IHI [Unix] [Mono] | V" + Assembly.GetExecutingAssembly().GetName().Version.ToString(4); Console.WriteLine("\n IHI [Unix] [Mono] | V" + Assembly.GetExecutingAssembly().GetName().Version.ToString(4) + "\n"); } Console.Beep(); CoreManager.InitialiseServerCore(); CoreManager.InitialiseInstallerCore(); BootResult bootResult = CoreManager.ServerCore.Boot(Path.Combine(Environment.CurrentDirectory, configFile)); CoreManager.DereferenceInstallerCore(); GC.Collect(); if (bootResult != BootResult.AllClear) { Console.WriteLine("\n\n\n IHI has failed to boot!"); if (disableAutoExit) { Console.WriteLine("\n\n Auto Exit Disabled - Press any key to exit!"); Console.ReadKey(true); } return; } // Reassign CTRL + C to safely shutdown. // CTRL + Break is still unsafe. Console.TreatControlCAsInput = false; Console.CancelKeyPress += ShutdownKey; while (true) { // Block all future input Console.ReadKey(true); } }
/// <summary> /// Configures <see cref="IServiceCollection">services</see> for the application /// </summary> /// <param name="services"><see cref="IServiceCollection"/> to configure</param> public void ConfigureServices(IServiceCollection services) { services.AddRouting(); _bootResult = services.AddDolittle(); }