Advertisement
Guest User

Startup

a guest
Nov 15th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.33 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.Builder;
  6. using Microsoft.AspNetCore.Hosting;
  7. using Microsoft.AspNetCore.Http;
  8. using Microsoft.AspNetCore.HttpsPolicy;
  9. using Microsoft.Extensions.Configuration;
  10. using Microsoft.Extensions.DependencyInjection;
  11. using Microsoft.Extensions.Hosting;
  12. using TEmailBotNgrok.Services;
  13.  
  14. namespace TEmailBotNgrok
  15. {
  16.     public class Startup
  17.     {
  18.         public Startup(IConfiguration configuration)
  19.         {
  20.             Configuration = configuration;
  21.         }
  22.  
  23.         public IConfiguration Configuration { get; }
  24.  
  25.         // This method gets called by the runtime. Use this method to add services to the container.
  26.         public void ConfigureServices(IServiceCollection services)
  27.         {
  28.             //services.AddControllersWithViews();
  29.             services.AddMvc();
  30.             services.AddMvc(options => options.EnableEndpointRouting = false);
  31.             services.AddScoped<IUpdateService, UpdateService>();
  32.             services.AddSingleton<IBotService, BotService>();
  33.  
  34.             services.Configure<BotConfiguration>(Configuration.GetSection("BotConfiguration"));
  35.         }
  36.  
  37.         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
  38.         public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
  39.         {
  40.             //if (env.IsDevelopment())
  41.             //{
  42.             //    app.UseDeveloperExceptionPage();
  43.             //}
  44.             //else
  45.             //{
  46.             //    app.UseExceptionHandler("/Home/Error");
  47.             //    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
  48.             //    app.UseHsts();
  49.             //}
  50.             ////app.UseMvc();
  51.             //app.UseHttpsRedirection();
  52.             //app.UseStaticFiles();
  53.  
  54.             //app.UseRouting();
  55.  
  56.             //app.UseAuthorization()
  57.  
  58.             //app.UseEndpoints(endpoints =>
  59.             //{
  60.             //    endpoints.MapControllerRoute(
  61.             //        name: "default",
  62.             //        pattern: "{controller=Home}/{action=Index}/{id?}");
  63.             //});
  64.             app.UseMvc();
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement