Skip to content
Permalink
Browse files

Add skeleton main function

  • Loading branch information...
bradparker committed Oct 2, 2019
1 parent 07e9d50 commit 1cfca981466baa84530cf0b233df75668b7b9a7d
Showing with 11 additions and 1 deletion.
  1. +2 −0 how-does-servants-type-dsl-work.cabal
  2. +9 −1 src/Main.hs
@@ -11,5 +11,7 @@ executable server
build-depends: base ^>=4.12.0.0
, servant-server
, time
, wai
, warp
hs-source-dirs: src
default-language: Haskell2010
@@ -1,18 +1,23 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wall #-}

module Main where

import Data.Proxy (Proxy(Proxy))
import Data.Time (Day)
import GHC.Generics (Generic)
import Network.Wai (Application)
import Network.Wai.Handler.Warp (run)
import Servant
( (:<|>)
, (:>)
, Capture
, Get
, JSON
, serve
)

data User = User
@@ -34,5 +39,8 @@ type UsersAPI =
"users"
:> (UsersIndex :<|> UsersShow)

usersApp :: Application
usersApp = serve (Proxy @UsersAPI) _usersServer

main :: IO ()
main = putStrLn "Hello, Haskell!"
main = run 8080 usersApp

0 comments on commit 1cfca98

Please sign in to comment.
You can’t perform that action at this time.