Beispiel #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddCors(options => {
                options.AddPolicy("AllowMyOrigin",
                                  builder => builder.WithOrigins("http://localhost:4200"));
            });

            DependencyInjectConfig.Register(services, Configuration);
        }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllersWithViews()
            .AddJsonOptions(options => {
                // set this option to TRUE to indent the JSON output
                options.JsonSerializerOptions.WriteIndented = true;
                // set this option to NULL to use PascalCase instead of CamelCase (default)
                // options.JsonSerializerOptions.PropertyNamingPolicy = null;
            });


            // In production, the Angular files will be served from this directory
            services.AddSpaStaticFiles(configuration =>
            {
                configuration.RootPath = "ClientApp/dist";
            });

            DependencyInjectConfig.Register(services);
        }