Example #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public virtual void Configure(IApplicationBuilder app, IHostingEnvironment env,
                                      ILoggerFactory loggerFactory /*, FittifyContext fittifyContext*/)
        {
            if (!env.IsClientTestServer()
                ) // need to exclude automapper initialization for full integration test of client app, because mapper is also initialized in Api Startup
            {
                AutoMapperForFittifyWeb.Initialize();
            }

            loggerFactory.AddConsole();
            loggerFactory.CreateLogger("My Logger");

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

            app.UseFileServer();
            // is equivalent to:
            //app.UseDefaultFiles();
            //app.UseStaticFiles();

            app.UseAuthentication();

            //app.UseMvcWithDefaultRoute(); // or do it more explicitly:
            app.UseMvc(routes =>
            {
                routes.MapRouteAnalyzer("/routes");
                routes.MapRoute("Default",
                                "{controller=Home}/{action=Index}/{id?}");
            });

            app.Run(async(context) =>
            {
                await context.Response.WriteAsync(
                    "Hello World from startup.cs If you clicked a linked after landing on this page, then the link was dead!");
            });
        }
Example #2
0
 public void Init()
 {
     AutoMapperForFittifyWeb.Initialize();
 }