Simplify catch-all route; bump admin theme version

This commit is contained in:
Daniel J. Summers 2025-07-05 13:40:06 -04:00
parent 161a61823f
commit ba5e27e011
2 changed files with 4 additions and 9 deletions

View File

@ -28,15 +28,13 @@ module CatchAll =
"wwwroot"
if textLink.Length > 1 then textLink[1..] else textLink ]
|> String.concat (string Path.DirectorySeparatorChar)
match File.Exists staticFileName with
| true ->
if File.Exists staticFileName then
debug (fun () -> $"File {textLink} is a static file")
yield
File.GetLastWriteTimeUtc staticFileName
|> System.DateTimeOffset
|> Some
|> streamFile true staticFileName None
| false -> ()
// Home page directory without the directory slash
if textLink = "" then yield redirectTo true (webLog.RelativeUrl Permalink.Empty)
let permalink = Permalink textLink[1..]
@ -99,11 +97,8 @@ module CatchAll =
}
// GET {all-of-the-above}
let route : HttpHandler = fun next ctx -> task {
match deriveAction ctx |> Seq.tryHead with
| Some handler -> return! handler next ctx
| None -> return None // Error.notFound next ctx
}
let route : HttpHandler = fun next ctx ->
match deriveAction ctx |> Seq.tryHead with Some handler -> handler next ctx | None -> Error.notFound next ctx
/// Serve theme assets
module Asset =

View File

@ -1,2 +1,2 @@
myWebLog Admin
2.2
3