Example #1
0
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            app.AddCORSPolicy();

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

                //populate datastorage
                app.PopulateTMCStorage();
            }
            else
            {
                app.AddAppErrorHandling();
                //populate datastorage
                app.PopulateTMCStorage();
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }