Skip to content

Instantly share code, notes, and snippets.

@miikka
Created October 5, 2010 13:16
Show Gist options
  • Save miikka/611529 to your computer and use it in GitHub Desktop.
Save miikka/611529 to your computer and use it in GitHub Desktop.
Snap project template.
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Snap.Types
import Snap.Http.Server
import Snap.Util.FileServe
main = do
let handler = route [ ("", writeBS "Hello world!")
, ("public", fileServe "public")
]
-- address, port, hostname, access log, error log, handler
httpServe "*" 8080 "localhost" Nothing Nothing handler
Name: snap-helloworld
Version: 0.1
Category: Web
Build-type: Simple
Cabal-version: >=1.6
Executable snap-helloworld
HS-Source-dirs: src
Main-is: Main.hs
Other-modules:
Build-depends: base ==4.*,
snap-core,
snap-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment