Add basic working hello world example
This commit is contained in:
parent
72a56aaaa2
commit
29215421f3
|
@ -1,2 +1,3 @@
|
|||
.cabal-sandbox
|
||||
cabal.sandbox.config
|
||||
dist/
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <http://unlicense.org/>
|
|
@ -0,0 +1,13 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module Main where
|
||||
|
||||
import Data.Monoid
|
||||
import Web.Spock.Safe
|
||||
|
||||
main :: IO ()
|
||||
main =
|
||||
runSpock 5000 $ spockT id $
|
||||
do get root $
|
||||
text "Hello World!"
|
||||
get ("hello" <//> var) $ \name ->
|
||||
text ("Hello " <> name <> "!")
|
|
@ -58,9 +58,10 @@ executable time-wasting-thread-memorial
|
|||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <4.7
|
||||
, Spock >=0.7.9
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
hs-source-dirs: src
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
|
Loading…
Reference in New Issue