Skip to content

scotty-web/scotty-tls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scotty-TLS

You can test by generating a self-signed certificate like this:

openssl req -nodes -newkey rsa:2048 -keyout example.key -out example.csr \
    -subj "/C=GB/ST=London/L=London/O=Acme Widgets/OU=IT Department/CN=example.com"
openssl x509 -req -days 365 -in example.csr -signkey example.key -out example.crt

For more details on making certificates, see this guide.

Install and run with:

cabal update && cabal install scotty-tls
{-# LANGUAGE OverloadedStrings #-}

import           Data.Monoid    (mconcat)
import           Web.Scotty
import           Web.Scotty.TLS

main :: IO ()
main = scottyTLS 3000 "server.key" "server.crt" $ do
         get "/:word" $ do
             beam <- param "word"
             html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"]

Releases

No releases published

Packages

No packages published