Created
August 7, 2018 05:48
-
-
Save AkosLukacs/e941528fcd3f813a25b3b6050dcb11d5 to your computer and use it in GitHub Desktop.
Set up MiniProfiler - index page with the profiler UI bits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Views | |
open Giraffe | |
open GiraffeViewEngine | |
open Microsoft.AspNetCore.Http | |
open StackExchange.Profiling | |
let index (ctx: HttpContext) = | |
// Just render the includes | |
let mp = MiniProfiler.Current.RenderIncludes(ctx) | |
// actual html starts here | |
html [] [ | |
head [] [ | |
meta [ _httpEquiv "Content-Type"; _content "text/html"; _charset "utf-8" ] | |
title [ ] [ encodedText "SAFE demo with MiniProfiler for .NET" ] | |
meta [ _name "viewport"; _content "width=device-width, initial-scale=1"] | |
link [ _rel "stylesheet"; _type "text/css"; _href "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css" ] | |
link [ _rel "stylesheet"; _type "text/css"; _href "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" ] | |
link [ _rel "stylesheet"; _type "text/css"; _href "https://fonts.googleapis.com/css?family=Open+Sans" ] | |
link [ _rel "shortcut icon"; _href "/Images/safe_favicon.png"; _type "image/png" ] | |
] | |
body [ ] [ | |
div [ _id "elmish-app" ] [] | |
// Include MiniProfiler script before your main js bundle, because MiniProfiler 'patches' XHR, fetch, etc to profile those requests... | |
rawText mp.Value | |
script [ _src "./js/bundle.js" ] [ ] | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment