示例#1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            //per https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.1&tabs=visual-studio#routing-startup-code
            // static files should be called before UseRouting
            StaticFiles.Configure(app, env);

            app.UseRouting();
            Cors.Configure(app, env);
            Authentication.Configure(app, env);


            app.UseEndpoints(endpoints => {
                endpoints.MapControllers();
                endpoints.MapHub <ChatHub>("/chathub");
                endpoints.MapHub <NotificationHub>("/notificationhub");
            });

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHttpsRedirection();
                app.UseDeveloperExceptionPage();
                app.UseHsts();
            }

            MVC.Configure(app, env);

            SPA.Configure(app, env);
        }
示例#2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            Authentication.Configure(app, env);

            Cors.Configure(app, env);

            //app.UseSignalR(routes =>
            //{
            //    routes.MapHub<ChatHub>("/chathub");
            //});

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHttpsRedirection();
                app.UseDeveloperExceptionPage();
                app.UseHsts();
            }

            MVC.Configure(app, env);

            SPA.Configure(app, env);

            StaticFiles.Configure(app, env);
        }
示例#3
0
文件: Startup.cs 项目: darakeon/dfm
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        // ReSharper disable once UnusedMember.Global
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime life)
        {
            AppLog.ShowLogOnError(app);

            BaseModel.IsDev = env.IsDevelopment();
            TZ.Init(env.IsDevelopment());

            Config.Initialize(env);

            Security.DenyFrame(app);

            StaticFiles.Configure(app);

            Route.CreateRoutes();

            Rewrite.TestThemAll(app);

            Context.Set(app);

            Error.AddHandlers(app, env);

            Orm.Config(app, life);

            Context.SetLanguage(app, env);

            Access.Run(app);

            Route.Execute(app);
        }
示例#4
0
 public void Configure(IApplicationBuilder app)
 {
     app.UseHsts();
     app.UseHttpsRedirection();
     app.UseStaticFiles(StaticFiles.Configure());
     app.UseRouting();
     app.UseAuthentication();
     app.UseAuthorization();
     app.UseEndpoints(Endpoints.Configure);
 }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseDeveloperExceptionPage();
                app.UseHsts();
            }

            app.UseHttpsRedirection();

            Cors.Configure(app, env);

            Authentication.Configure(app, env);

            MVC.Configure(app, env);

            SPA.Configure(app, env);

            StaticFiles.Configure(app, env);
        }