2018-05-21 18:49:57 +02:00
|
|
|
|
using Microsoft.ApplicationInsights.Extensibility;
|
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
2017-08-25 16:59:27 +02:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
2017-08-15 18:03:55 +02:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2017-08-25 16:59:27 +02:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2017-08-15 18:03:55 +02:00
|
|
|
|
|
2017-09-08 17:45:20 +02:00
|
|
|
|
namespace Bit.Server
|
2017-08-15 18:03:55 +02:00
|
|
|
|
{
|
|
|
|
|
public class Startup
|
|
|
|
|
{
|
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
|
|
{ }
|
|
|
|
|
|
2017-08-25 16:59:27 +02:00
|
|
|
|
public void Configure(
|
|
|
|
|
IApplicationBuilder app,
|
|
|
|
|
ILoggerFactory loggerFactory,
|
2018-05-21 18:49:57 +02:00
|
|
|
|
IConfiguration configuration,
|
|
|
|
|
TelemetryConfiguration telemetryConfiguration)
|
2017-08-15 18:03:55 +02:00
|
|
|
|
{
|
2018-05-21 18:49:57 +02:00
|
|
|
|
telemetryConfiguration.DisableTelemetry = true;
|
2017-08-25 16:59:27 +02:00
|
|
|
|
loggerFactory
|
|
|
|
|
.AddConsole()
|
|
|
|
|
.AddDebug();
|
|
|
|
|
|
|
|
|
|
var serveUnknown = configuration.GetValue<bool?>("serveUnknown") ?? false;
|
|
|
|
|
if(serveUnknown)
|
|
|
|
|
{
|
|
|
|
|
app.UseStaticFiles(new StaticFileOptions
|
|
|
|
|
{
|
|
|
|
|
ServeUnknownFileTypes = true,
|
|
|
|
|
DefaultContentType = "application/octet-stream"
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
app.UseFileServer();
|
|
|
|
|
}
|
2017-08-15 18:03:55 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|