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, IHostingEnvironment env)
        {
            app.ApplicationServices.GetServices <IConnectionService>();
            IDirectoryPathService directoryPathService = app.ApplicationServices.GetService <IDirectoryPathService>();

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

            app.UseMvc();

            FileServerOptions fileServerOptions = new FileServerOptions()
            {
                FileProvider            = new PhysicalFileProvider(Path.Combine(directoryPathService.RootPath, "static")),
                RequestPath             = "",
                EnableDirectoryBrowsing = false
            };

            fileServerOptions.DefaultFilesOptions.DefaultFileNames.Add("index.html");
            app.UseFileServer(fileServerOptions);

            ConfigureWebSockets(app);
        }
Esempio n. 2
0
 public VideoSourceDatabase(IDirectoryPathService directoryPathService)
 {
     _filePath = Path.Combine(directoryPathService.RootPath, "sources.json");
 }