Skip to content

Instantly share code, notes, and snippets.

@AkosLukacs
Created August 7, 2018 05:27
Show Gist options
  • Save AkosLukacs/57740e941200b69c35f6690c717af615 to your computer and use it in GitHub Desktop.
Save AkosLukacs/57740e941200b69c35f6690c717af615 to your computer and use it in GitHub Desktop.
Configure miniprofiler in a Giraffe app
let configureApp (app : IApplicationBuilder) =
app.UseDefaultFiles()
.UseStaticFiles()
// this line
.UseMiniProfiler()
.UseGiraffe webApp
let configureServices (services : IServiceCollection) =
services.AddGiraffe() |> ignore
// IMemoryCache is required for MiniProfiler's in-memory storage
services.AddMemoryCache()
// Add MiniProfiler itself
.AddMiniProfiler(fun mp ->
// Config options for ASP.NET Core: https://miniprofiler.com/dotnet/AspDotNetCore
mp.ShowControls <- true
mp.PopupRenderPosition <- RenderPosition.Right
// TODO: set up authentication, authorization!
()) |> ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment