Skip to content

Instantly share code, notes, and snippets.

@CarstenKoenig
Created September 25, 2017 15:42
Show Gist options
  • Save CarstenKoenig/dc342e424178ffe3b9783f54b47d8d74 to your computer and use it in GitHub Desktop.
Save CarstenKoenig/dc342e424178ffe3b9783f54b47d8d74 to your computer and use it in GitHub Desktop.
Demonstration of getting a scotty server running as a script - needs stack
#!/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>"]
@CarstenKoenig
Copy link
Author

CarstenKoenig commented Sep 25, 2017

btw: there is just a single route you can test by http://localhost:3000/Haskell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment