-
I am coming from C# background and started playing with F# web apps. I have a small Program.fs file I created from the Giraffe Get Started page. I want to see the source code for the Program.fs open Microsoft.AspNetCore.Hosting
open Microsoft.AspNetCore.Builder
open Giraffe
open Microsoft.Extensions.Hosting
open Microsoft.Extensions.DependencyInjection
open Microsoft.Extensions.Logging
let webApp =
choose [ route "/ping" >=> text "pong" // I try to go to definition here on the route function
route "/" >=> htmlFile "/pages/index.html" ]
type Startup() =
member __.ConfigureServices(services: IServiceCollection) =
// Register default Giraffe dependencies
services.AddGiraffe() |> ignore
member __.Configure (app: IApplicationBuilder) (env: IHostEnvironment) (loggerFactory: ILoggerFactory) =
// Add Giraffe to the ASP.NET Core pipeline
app.UseGiraffe webApp
[<EntryPoint>]
let main argv =
Host
.CreateDefaultBuilder()
.ConfigureWebHostDefaults(fun webHostBuilder -> webHostBuilder.UseStartup<Startup>() |> ignore)
.Build()
.Run()
0
.fsproj file <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Giraffe" Version="4.1.0" />
</ItemGroup>
</Project> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
There's a version of this coming in the VS 16.10 update, but only for non-F# constructs. It will enable a decompiled view. For example, this is from But as mentioned, this doesn't work yet for an F# project yet. |
Beta Was this translation helpful? Give feedback.
There's a version of this coming in the VS 16.10 update, but only for non-F# constructs. It will enable a decompiled view. For example, this is from
IHostEnvironment
:But as mentioned, this doesn't work yet for an F# project yet.