コード例 #1
0
ファイル: Startup.cs プロジェクト: slashgg/passport
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.UseForwardedHeaders();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();

                var webpackOptions = new Microsoft.AspNetCore.SpaServices.Webpack.WebpackDevMiddlewareOptions();
                webpackOptions.ProjectPath = Path.Combine(env.ContentRootPath, "ClientApp");
                webpackOptions.EnvParam    = new { mode = "development" };
                app.UseWebpackDevMiddleware(webpackOptions);
            }
            else
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseSpaStaticFiles();
            app.UseAuthentication();

            app.UseCors();

            app.UseIdentityServer();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "api/{area}/{controller=Home}/{action=Index}/{id?}");
            });


            app.UseSpa(spa =>
            {
                spa.Options.SourcePath = "ClientApp";
            });
        }
コード例 #2
0
 public static void UseWebpackDevMiddleware(this Microsoft.AspNetCore.Builder.IApplicationBuilder appBuilder, Microsoft.AspNetCore.SpaServices.Webpack.WebpackDevMiddlewareOptions options = null)
 {
 }