Simplify catch-all route; bump admin theme version
This commit is contained in:
parent
161a61823f
commit
ba5e27e011
@ -28,15 +28,13 @@ module CatchAll =
|
|||||||
"wwwroot"
|
"wwwroot"
|
||||||
if textLink.Length > 1 then textLink[1..] else textLink ]
|
if textLink.Length > 1 then textLink[1..] else textLink ]
|
||||||
|> String.concat (string Path.DirectorySeparatorChar)
|
|> String.concat (string Path.DirectorySeparatorChar)
|
||||||
match File.Exists staticFileName with
|
if File.Exists staticFileName then
|
||||||
| true ->
|
|
||||||
debug (fun () -> $"File {textLink} is a static file")
|
debug (fun () -> $"File {textLink} is a static file")
|
||||||
yield
|
yield
|
||||||
File.GetLastWriteTimeUtc staticFileName
|
File.GetLastWriteTimeUtc staticFileName
|
||||||
|> System.DateTimeOffset
|
|> System.DateTimeOffset
|
||||||
|> Some
|
|> Some
|
||||||
|> streamFile true staticFileName None
|
|> streamFile true staticFileName None
|
||||||
| false -> ()
|
|
||||||
// Home page directory without the directory slash
|
// Home page directory without the directory slash
|
||||||
if textLink = "" then yield redirectTo true (webLog.RelativeUrl Permalink.Empty)
|
if textLink = "" then yield redirectTo true (webLog.RelativeUrl Permalink.Empty)
|
||||||
let permalink = Permalink textLink[1..]
|
let permalink = Permalink textLink[1..]
|
||||||
@ -99,11 +97,8 @@ module CatchAll =
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GET {all-of-the-above}
|
// GET {all-of-the-above}
|
||||||
let route : HttpHandler = fun next ctx -> task {
|
let route : HttpHandler = fun next ctx ->
|
||||||
match deriveAction ctx |> Seq.tryHead with
|
match deriveAction ctx |> Seq.tryHead with Some handler -> handler next ctx | None -> Error.notFound next ctx
|
||||||
| Some handler -> return! handler next ctx
|
|
||||||
| None -> return None // Error.notFound next ctx
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Serve theme assets
|
/// Serve theme assets
|
||||||
module Asset =
|
module Asset =
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
myWebLog Admin
|
myWebLog Admin
|
||||||
2.2
|
3
|
Loading…
x
Reference in New Issue
Block a user