|
|
@@ -14,32 +14,29 @@ open Microsoft.Extensions.Configuration
|
|
|
open Microsoft.Extensions.DependencyInjection
|
|
|
open Microsoft.Extensions.Hosting
|
|
|
|
|
|
-type Startup private () =
|
|
|
- new (configuration: IConfiguration) as this =
|
|
|
- Startup() then
|
|
|
- this.Configuration <- configuration
|
|
|
+type Startup(configuration: IConfiguration) =
|
|
|
+ member _.Configuration = configuration
|
|
|
|
|
|
// This method gets called by the runtime. Use this method to add services to the container.
|
|
|
- member this.ConfigureServices(services: IServiceCollection) =
|
|
|
+ member _.ConfigureServices(services: IServiceCollection) =
|
|
|
// Add framework services.
|
|
|
services.AddControllers() |> ignore
|
|
|
|
|
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
|
- member this.Configure(app: IApplicationBuilder, env: IWebHostEnvironment) =
|
|
|
+ member _.Configure(app: IApplicationBuilder, env: IWebHostEnvironment) =
|
|
|
if (env.IsDevelopment()) then
|
|
|
app.UseDeveloperExceptionPage() |> ignore
|
|
|
#if (!NoHttps)
|
|
|
-
|
|
|
- app.UseHttpsRedirection() |> ignore
|
|
|
+ app.UseHttpsRedirection()
|
|
|
+ .UseRouting()
|
|
|
+ .UseAuthorization()
|
|
|
+ .UseEndpoints(fun endpoints ->
|
|
|
+ endpoints.MapControllers() |> ignore
|
|
|
+ ) |> ignore
|
|
|
#else
|
|
|
-
|
|
|
+ app.UseRouting()
|
|
|
+ .UseAuthorization()
|
|
|
+ .UseEndpoints(fun endpoints ->
|
|
|
+ endpoints.MapControllers() |> ignore
|
|
|
+ ) |> ignore
|
|
|
#endif
|
|
|
- app.UseRouting() |> ignore
|
|
|
-
|
|
|
- app.UseAuthorization() |> ignore
|
|
|
-
|
|
|
- app.UseEndpoints(fun endpoints ->
|
|
|
- endpoints.MapControllers() |> ignore
|
|
|
- ) |> ignore
|
|
|
-
|
|
|
- member val Configuration : IConfiguration = null with get, set
|