Created
September 25, 2017 15:42
-
-
Save CarstenKoenig/dc342e424178ffe3b9783f54b47d8d74 to your computer and use it in GitHub Desktop.
Demonstration of getting a scotty server running as a script - needs stack
This file contains hidden or 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
#!/usr/bin/env stack | |
-- stack --resolver lts-9.5 script --package scotty | |
{-# LANGUAGE OverloadedStrings #-} | |
import Web.Scotty | |
import Data.Monoid (mconcat) | |
main = scotty 3000 $ do | |
get "/:word" $ do | |
beam <- param "word" | |
html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
btw: there is just a single route you can test by http://localhost:3000/Haskell