Skip to content

Instantly share code, notes, and snippets.

@ostronom
Created August 22, 2013 10:04
Show Gist options
  • Select an option

  • Save ostronom/6305409 to your computer and use it in GitHub Desktop.

Select an option

Save ostronom/6305409 to your computer and use it in GitHub Desktop.
hello-world wai-warp server
module Main where
import Network.Wai.Handler.Warp (run)
import qualified Routes as R
main = do
run 3000 R.routes
name: Project
version: 1.0.0
build-type: Simple
cabal-version: >= 1.2
license: MIT
author: Author
homepage: http://example.com
category: Testing
synopsis: synopsis
executable main
main-is: Main.hs
hs-source-dirs: src
build-depends: base >= 4 && < 5
, conduit >= 1 && < 1.1
, http-types >= 0.8 && < 1
, wai >= 1.4 && < 1.5
, warp >= 1.3 && < 1.4
{-# LANGUAGE OverloadedStrings #-}
module Routes where
import Network.Wai
import Network.HTTP.Types (ok200)
import Data.Conduit
routes :: Request -> ResourceT IO Response
routes req = return $ responseLBS ok200 [] "OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment