コード例 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, MarsContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Init db
            DBInitialiser.Initialize(context);

            // CORS
            app.UseCors(options =>
                        options.AllowAnyOrigin()
                        .AllowAnyMethod()
                        .AllowAnyHeader());

            app.UseAuthentication();
            app.UseMvc();
        }
コード例 #2
0
 public PhotoController(MarsContext ctxt)
 {
     _context = ctxt;
 }