Created
January 4, 2015 21:59
-
-
Save mpickering/fe079e41a9f30f9e683f to your computer and use it in GitHub Desktop.
Simple servant example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds, TypeFamilies, TypeOperators, OverloadedStrings #-} | |
module M where | |
import Servant.Server | |
import Servant | |
import Data.Text (Text) | |
import Network.Wai.Handler.Warp | |
import Data.Proxy | |
myApi :: Proxy MyApi | |
myApi = Proxy | |
type MyApi = "string" :> Get Text | |
server :: Server MyApi | |
server = return "some text" | |
main :: IO () | |
main = run 8080 (serve myApi server) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment