diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a36c150 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "app/Common"] + path = app/Common + url = tanl-github:towards-a-new-leftypol/chandlr-common.git diff --git a/app/Common b/app/Common new file mode 160000 index 0000000..ef17561 --- /dev/null +++ b/app/Common @@ -0,0 +1 @@ +Subproject commit ef175614910eb82550bfca5e95558c416aca82bb diff --git a/app/Main.hs b/app/Main.hs index 65ae4a0..7565718 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -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 diff --git a/chandlr-server.cabal b/chandlr-server.cabal index 8217ff9..ee319c0 100644 --- a/chandlr-server.cabal +++ b/chandlr-server.cabal @@ -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