aboutsummaryrefslogtreecommitdiff
path: root/TJLaskuri.Web/Modules/Index.fs
diff options
context:
space:
mode:
Diffstat (limited to 'TJLaskuri.Web/Modules/Index.fs')
-rw-r--r--TJLaskuri.Web/Modules/Index.fs31
1 files changed, 31 insertions, 0 deletions
diff --git a/TJLaskuri.Web/Modules/Index.fs b/TJLaskuri.Web/Modules/Index.fs
new file mode 100644
index 0000000..7623779
--- /dev/null
+++ b/TJLaskuri.Web/Modules/Index.fs
@@ -0,0 +1,31 @@
+module TJLaskuri.Web.Modules.Index
+
+open System
+open Falco
+open TJLaskuri.Core
+
+[<AutoOpen>]
+module Views =
+ open TJLaskuri.Core.Views
+
+ type Model = {
+ Counter : Main.Model
+ }
+
+ let view model =
+ Main.view model.Counter
+ |> Document.view
+
+let get : HttpHandler =
+ fun ctx ->
+ let time = DateTime.Now
+ let kontingent = kontingent 2 2025
+ let timeLeft = Domain.getTimeLeft kontingent ThreeFourSeven time |> Option.get
+ let completed = Domain.getTimeCompleted kontingent time |> Option.get
+
+ view {
+ Counter = {
+ TimeLeft = timeLeft
+ TimeCompleted = completed
+ }
+ } |> Response.ofHtml <| ctx