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:
parent
1aad05afd4
commit
fc443e27bb
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "app/Common"]
|
||||||
|
path = app/Common
|
||||||
|
url = tanl-github:towards-a-new-leftypol/chandlr-common.git
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit ef175614910eb82550bfca5e95558c416aca82bb
|
26
app/Main.hs
26
app/Main.hs
|
@ -1,4 +1,28 @@
|
||||||
module Main where
|
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 :: IO ()
|
||||||
main = putStrLn "Hello, Haskell!"
|
main = do
|
||||||
|
putStrLn $ "Serving front-end on port " ++ show port
|
||||||
|
|
||||||
|
Wai.run port $ Wai.logStdout app
|
||||||
|
|
|
@ -62,13 +62,26 @@ executable chandlr-server
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
|
|
||||||
-- Modules included in this executable, other than Main.
|
-- 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.
|
-- LANGUAGE extensions used by modules in this package.
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
|
|
||||||
-- Other library packages from which modules are imported.
|
-- 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.
|
-- Directories containing source files.
|
||||||
hs-source-dirs: app
|
hs-source-dirs: app
|
||||||
|
|
Loading…
Reference in New Issue