Skip to content

Instantly share code, notes, and snippets.

@kunjee17
Created July 24, 2018 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunjee17/b6ca8b6d3b67228e677cec61a15fcb73 to your computer and use it in GitHub Desktop.
Save kunjee17/b6ca8b6d3b67228e677cec61a15fcb73 to your computer and use it in GitHub Desktop.
open Giraffe
let webApp =
choose [
route "/ping" >=> text "pong"
route "/" >=> htmlFile "/pages/index.html" ]
type Startup() =
member __.ConfigureServices (services : IServiceCollection) =
// Register default Giraffe dependencies
services.AddGiraffe() |> ignore
member __.Configure (app : IApplicationBuilder)
(env : IHostingEnvironment)
(loggerFactory : ILoggerFactory) =
// Add Giraffe to the ASP.NET Core pipeline
app.UseGiraffe webApp
[<EntryPoint>]
let main _ =
WebHostBuilder()
.UseKestrel()
.UseStartup<Startup>()
.Build()
.Run()
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment