Work in progress - get front-end routes working server side

- doesn't build
- doesn't work
- needs more of the front-end code in Common
This commit is contained in:
towards-a-new-leftypol 2024-03-05 20:45:07 -05:00
parent 1aad05afd4
commit fc443e27bb
4 changed files with 44 additions and 3 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "app/Common"]
path = app/Common
url = tanl-github:towards-a-new-leftypol/chandlr-common.git

1
app/Common Submodule

@ -0,0 +1 @@
Subproject commit ef175614910eb82550bfca5e95558c416aca82bb

View File

@ -1,4 +1,28 @@
module Main where
import Miso (ToServerRoutes)
import Data.Proxy
import qualified Network.Wai as Wai
import qualified Network.Wai.Handler.Warp as Wai
import qualified Network.Wai.Middleware.RequestLogger as Wai
import qualified Servant
import qualified Common.FrontEnd.Routes as FE
import qualified Common.FrontEnd.Action as FE
newtype HtmlPage a = HtmlPage a
-- deriving (Show, Eq)
type FrontEndRoutes = ToServerRoutes FE.Route HtmlPage FE.Action
app :: Wai.Application
app = undefined
port :: Int
port = 8888
main :: IO ()
main = putStrLn "Hello, Haskell!"
main = do
putStrLn $ "Serving front-end on port " ++ show port
Wai.run port $ Wai.logStdout app

View File

@ -62,13 +62,26 @@ executable chandlr-server
main-is: Main.hs
-- Modules included in this executable, other than Main.
-- other-modules:
other-modules:
Common.Component.Search.SearchTypes
Common.FrontEnd.Action
Common.FrontEnd.Routes
Common.Network.CatalogPostType
Common.Network.ClientTypes
Common.Network.HttpTypes
-- LANGUAGE extensions used by modules in this package.
-- other-extensions:
-- Other library packages from which modules are imported.
build-depends: base
build-depends: base,
wai,
wai-extra,
warp,
text,
time,
aeson,
miso
-- Directories containing source files.
hs-source-dirs: app