Hoogle Search
Within LTS Haskell 22.19 (ghc-9.6.4)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp A Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp.
{-# LANGUAGE OverloadedStrings #-} import Web.Scotty main = scotty 3000 $ get "/:word" $ do beam <- captureParam "word" html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"]
Scotty is the cheap and cheerful way to write RESTful, declarative web applications.- A page is as simple as defining the verb, url pattern, and Text content.
- It is template-language agnostic. Anything that returns a Text value will do.
- Conforms to WAI Application interface.
- Uses very fast Warp webserver by default.
scotty :: Port -> ScottyM () -> IO ()scotty Web.Scotty Run a scotty application using the warp server.
-
It should be noted that most of the code snippets below depend on the OverloadedStrings language pragma. Scotty is set up by default for development mode. For production servers, you will likely want to modify settings and the defaultHandler. See the comments on each of these functions for more information.
scottyApp :: ScottyM () -> IO Applicationscotty Web.Scotty Turn a scotty application into a WAI Application, which can be run with any WAI handler.
scottyOpts :: Options -> ScottyM () -> IO ()scotty Web.Scotty Run a scotty application using the warp server, passing extra options.
scottySocket :: Options -> Socket -> ScottyM () -> IO ()scotty Web.Scotty Run a scotty application using the warp server, passing extra options, and listening on the provided socket. This allows the user to provide, for example, a Unix named socket, which can be used when reverse HTTP proxying into your application.
scottyAppT :: (Monad m, Monad n) => (m Response -> IO Response) -> ScottyT m () -> n Applicationscotty Web.Scotty.Trans Turn a scotty application into a WAI Application, which can be run with any WAI handler. NB: scottyApp === scottyAppT id
-
scotty Web.Scotty.Trans Run a scotty application using the warp server, passing extra options. NB: scottyOpts opts === scottyOptsT opts id
-
scotty Web.Scotty.Trans Run a scotty application using the warp server, passing extra options, and listening on the provided socket. NB: scottySocket opts sock === scottySocketT opts sock id
scottyT :: (Monad m, MonadIO n) => Port -> (m Response -> IO Response) -> ScottyT m () -> n ()scotty Web.Scotty.Trans Run a scotty application using the warp server. NB: scotty p === scottyT p id
Page 1 of many | Next