feat: Hyperbole port compiles and builds successfully
- All page modules now use proper Page es '[ViewId] type with hyper embedding - Fixed view DSL: tag calls, String/Text conversions, polymorphic context types - DB effect uses convenience wrappers (lowercase) with send - HyperView instances have DB :> es, IOE :> es constraints - Main.hs uses liveAppWith with proper router - Static file serving deferred (will use nginx or wai-app-static) - Warning suppressions added where needed - Build produces working 25MB sis-server binary
This commit is contained in:
+7
-5
@@ -1,10 +1,13 @@
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
{-# OPTIONS_GHC -Wno-unused-imports -Wno-missing-export-lists #-}
|
||||
|
||||
module Main where
|
||||
|
||||
import Effectful
|
||||
import Network.Wai.Application.Static qualified as Static
|
||||
import Network.Wai.Handler.Warp qualified as Warp
|
||||
import Network.Wai.Middleware.Static qualified as Static
|
||||
import System.Directory (createDirectoryIfMissing)
|
||||
import System.FilePath (takeDirectory)
|
||||
|
||||
@@ -34,17 +37,16 @@ main = do
|
||||
let port = 8080
|
||||
putStrLn $ "[sis] listening on 0.0.0.0:" <> show port
|
||||
|
||||
Warp.run port $
|
||||
Static.staticPolicy (Static.addBase "frontend/static") $
|
||||
liveAppWith
|
||||
let app = liveAppWith
|
||||
(ServerOptions
|
||||
{ toDocument = document documentHead
|
||||
, serverError = defaultError
|
||||
, parseRequestBody = defaultParseRequestBodyOptions
|
||||
})
|
||||
(runDB conn $ routeRequest router)
|
||||
Warp.run port $ app
|
||||
|
||||
router :: (Hyperbole :> es, DB :> es) => AppRoute -> Eff es Response
|
||||
router :: (Hyperbole :> es, DB :> es, IOE :> es) => AppRoute -> Eff es Response
|
||||
router RouteHome = do
|
||||
redirect (routeUri RouteDashboard)
|
||||
router RouteLogin = runPage Sis.Page.Login.page
|
||||
|
||||
Reference in New Issue
Block a user