Skip to content

Instantly share code, notes, and snippets.

@mpickering
Created January 4, 2015 21:59
Show Gist options
  • Save mpickering/fe079e41a9f30f9e683f to your computer and use it in GitHub Desktop.
Save mpickering/fe079e41a9f30f9e683f to your computer and use it in GitHub Desktop.
Simple servant example
{-# 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