Esempio n. 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, PapersDbContext dbContext)
        {
            dbContext.Database.EnsureDeleted();
            dbContext.Database.Migrate();

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

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            // configuration for Angular client
            app.UseCors("CorsPolicy");

            app.UseSpaStaticFiles();

            app.UseEndpoints(endpoints => {
                endpoints.MapControllers();
                endpoints.MapHub <PlaygroundHub>("/playground");
            });

            app.UseSpa(spa =>
            {
                spa.Options.SourcePath = Path.Join(env.ContentRootPath, "PapersClient");

                if (env.IsDevelopment())
                {
                    spa.Options.StartupTimeout = new TimeSpan(0, 1, 90);
                    spa.UseAngularCliServer(npmScript: "start");
                }
            });
        }
Esempio n. 2
0
 public PapersController(PapersDbContext db)
 {
     this.db = db;
 }
Esempio n. 3
0
 public GameSessionDataService(PapersDbContext db)
 {
     this.db = db;
 }
Esempio n. 4
0
 public PlayersDataService(PapersDbContext db)
 {
     this.db = db;
 }