-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStartup.fs
39 lines (30 loc) · 1.27 KB
/
Startup.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
namespace RazorPagesFSharp
open System
open System.Collections.Generic
open System.Linq
open System.Threading.Tasks
open Microsoft.AspNetCore.Builder
open Microsoft.AspNetCore.Hosting
open Microsoft.Extensions.Configuration
open Microsoft.Extensions.DependencyInjection
type Startup private () =
new (configuration: IConfiguration) as this =
Startup() then
this.Configuration <- configuration
// This method gets called by the runtime. Use this method to add services to the container.
member this.ConfigureServices(services: IServiceCollection) =
// Add framework services.
services.AddMvc() |> ignore
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
member this.Configure(app: IApplicationBuilder, env: IHostingEnvironment) =
if (env.IsDevelopment()) then
app.UseDeveloperExceptionPage() |> ignore
else
app.UseExceptionHandler("/Error") |> ignore
app.UseStaticFiles() |> ignore
app.UseMvc(fun routes ->
routes.MapRoute(
name = "default",
template = "{controller}/{action=Index}/{id?}") |> ignore
) |> ignore
member val Configuration : IConfiguration = null with get, set