úÎPºL-"      ! Safe-Infered"#$%&'"#$%&"#$%&'None()*+,-./0123456789:;<=>?@()*+,-./0123456789:;<= *)(+,-./0125436789:;<=>?@ Safe-Infered-Throw an exception, which can be caught with . Uncaught exceptions  turn into HTTP 500 responses. EAbort execution of this action and continue pattern matching routes. # Like an exception, any code after  is not executed. JAs an example, these two routes overlap. The only way the second one will $ ever run is if the first one calls .  get "/foo/:number" $ do  n <- param "number" ! unless (all isDigit n) $ next  text "a number"   get "/foo/:bar" $ do  bar <- param "bar"  text "not a number" Catch an exception thrown by . 2 raise "just kidding" `rescue` (\msg -> text msg) cRedirect to given URL. Like throwing an uncatchable exception. Any code after the call to redirect  will not be run.  " redirect "http://www.google.com" OR  redirect "/foo/bar" Get the A object. Get the request body. eParse the request body as a JSON object and return it. Raises an exception if parse is unsuccessful. QGet a parameter. First looks in captures, then form data, then query parameters. , Raises an exception which can be caught by  if parameter is not found.  If parameter is found, but B% fails to parse to the correct type,  is called. > This means captures are somewhat typed, in that a route won't match if a correctly typed  capture cannot be parsed. .Set the HTTP response status. Default is 200. YSet one of the response headers. Will override any previously set value for that header. $ Header names are case-insensitive. *Set the body of the response to the given C value. Also sets " Content-Type"  header to "text/plain". *Set the body of the response to the given C value. Also sets " Content-Type"  header to "text/html". "Send a file as the response. Doesn' t set the " Content-Type" header, so you probably " want to do that on your own with . PSet the body of the response to the JSON encoding of the given value. Also sets " Content-Type"  header to " application/json". D EFGHIJKLMND D EFGHIJKLMN Safe-Infered ;An action (executed when a route matches) can either be an  computation, or I a function with an argument for each capture in the route. For example:  ' get "/lambda/:foo/:bar" $ \ a b -> do  text $ mconcat [a,b] is elaborated by Scotty to:  get "/lambda/:foo/:bar" $ do  a <- param "foo"  b <- param "bar"  text $ mconcat [a,b] get =  O post =  P put =  Q  delete =  R 6Add a route that matches regardless of the HTTP verb. QSpecify an action to take if nothing else is found. Note: this _always_ matches, 2 so should generally be the last route specified. Define a route with a S, C# value representing the path spec,  and a body () which modifies the response.  ' addroute GET "/" $ text "beam me up!" NThe path spec can include values starting with a colon, which are interpreted  as captures7. These are named wildcards that can be looked up with  .   addroute GET "/foo/:bar" $ do  v <- param "bar"  text v (curl http://localhost:3000/foo/something something+Match requests using a regular expression. ) Named captures are not yet supported.   get (regex "^/f(.*)r$") $ do  path <- param "0"  cap <- param "1" 8 text $ mconcat ["Path: ", path, "\nCapture: ", cap] "curl http://localhost:3000/foo/barPath: /foo/barCapture: oo/baHStandard Sinatra-style route. Named captures are prepended with colons. M This is the default route type generated by OverloadedString routes. i.e.  ! get (capture "/foo/:bar") $ ... and  $ {-# LANGUAGE OverloadedStrings #-}  ...  get "/foo/:bar" $ ... are equivalent. CBuild a route based on a function which can match using the entire A object.  T' indicates the route does not match. A U value indicates Q a successful match, optionally returning a list of key-value pairs accessible  by  .  S get (function $ \req -> Just [("version", T.pack $ show $ httpVersion req)]) $ do  v <- param "version"  text v curl http://localhost:3000/HTTP/1.1PBuild a route that requires the requested path match exactly, without captures. VW VW Safe-Infered0Run a scotty application using the warp server. %Turn a scotty application into a WAI X, which can be  run with any WAI handler. !HUse given middleware. Middleware is nested such that the first declared O is the outermost middleware (it has first dibs on the request and last action < on the response). Every middleware is run on each request.  !"  !" !  !Y      !"#$%&'()*+,-./01234567898:;<==>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[YZ\YZ]YZ^YZ_H`aH`bcdEFef scotty-0.4.2 Web.ScottyWeb.Scotty.UtilWeb.Scotty.TypesWeb.Scotty.ActionWeb.Scotty.Route RoutePatternActionMParamScottyMParsableraisenextrescueredirectrequestbodyjsonDataparamstatusheadertexthtmlfilejsonActiongetpostputdeletematchAnynotFoundaddrouteregexcapturefunctionliteralscotty scottyApp middlewarelazyTextToStrictByteStringstrictByteStringToLazyText setContent setHeader setStatus$fDefaultResponseFunctionLiteralCaptureAMrunAM ActionEnvEnvgetReq getParamsgetBody ActionErrorNextRedirectSrunS ScottyState middlewaresroutes addMiddlewareaddRoute$fIsStringRoutePattern$fErrorActionError$fDefaultScottyState wai-1.2.0.1 Network.WaiRequestbase Text.Readread text-0.11.2.0Data.Text.Lazy.InternalText runAction$fParsableInteger $fParsableInt$fParsableFloat$fParsableDouble$fParsableBool $fParsable[] $fParsable()$fParsableChar$fParsableByteString$fParsableTexthttp-types-0.6.10Network.HTTP.TypesGETPOSTPUTDELETE StdMethod Data.MaybeNothingJust $fAction(->)$fActionActionM Application