úÎ!ö˛ęöś      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľNone 2=?@AHMV¨ scotty4In order to use a custom exception type (aside from ś#), you must define an instance of   for that type.4scotty#0 = silent, 1(def) = startup banner5scottyWarp ˇď Note: to work around an issue in warp, the default FD cache duration is set to 0 so changes to static files are always picked up. This likely has performance implications, so you may want to modify this for production servers using setFdCacheDuration.9   "!#$'&%()*+,/.-0123546789235410+,/.-678()*#$'&% "!   NoneŚ ¸šşťź˝žżŔÁNoneSXRö XscottyMinimum implemention: YYscottyTake a ś value and parse it as a, or fail with a message.Zscotty4Default implementation parses comma-delimited lists. 7parseParamList t = mapM parseParam (T.split (== ',') t)Âscotty&Default error handler for all actions.[scotty-Throw an exception, which can be caught with ^4. Uncaught exceptions turn into HTTP 500 responses.\scotty-Throw an exception, which can be caught with ^Q. Uncaught exceptions turn into HTTP responses corresponding to the given status.]scottyhAbort execution of this action and continue pattern matching routes. Like an exception, any code after ] is not executed.nAs an example, these two routes overlap. The only way the second one will ever run is if the first one calls ]. Ëget "/foo/:bar" $ do w :: Text <- param "bar" unless (w == "special") next text "You made a request to /foo/special" get "/foo/:baz" $ do w <- param "baz" text $ "You made a request to: " <> w^scottyCatch an exception thrown by [. 0raise "just kidding" `rescue` (\msg -> text msg)_scottyLike Ă1, but catch any IO exceptions and turn them into  s.`scottytRedirect 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"ascotty‡Finish the execution of the current action. Like throwing an uncatchable exception. Any code after the call to finish will not be run. Since: 0.10.3bscottyGet the Ä object.cscottyGet list of uploaded files.dscotty6Get a request header. Header name is case-insensitive.escotty?Get all the request headers. Header names are case-insensitive.fscottyGet the request body.gscotty'Get an IO action that reads body chunksThis is incompatible with f since f consumes all chunks.hscotty6Parse the request body as a JSON object and return it.eIf the JSON object is malformed, this sets the status to 400 Bad Request, and throws an exception.PIf the JSON fails to parse, this sets the status to 422 Unprocessable Entity.These status codes are as per  4https://www.restapitutorial.com/httpstatuscodes.html.iscottyPGet 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 Ĺ% 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.jscotty@Get all parameters from capture, form and query (in that order).kscottyUseful for creating X- instances for things that already implement Ć. Ex: 3instance Parsable Int where parseParam = readEitherlscotty-Set the HTTP response status. Default is 200.mscotty?Add to the response headers. Header names are case-insensitive.nscotty|Set one of the response headers. Will override any previously set value for that header. Header names are case-insensitive.oscotty*Set the body of the response to the given śg value. Also sets "Content-Type" header to "text/plain; charset=utf-8" if it has not already been set.pscotty*Set the body of the response to the given śf value. Also sets "Content-Type" header to "text/html; charset=utf-8" if it has not already been set.qscottyvSend a file as the response. Doesn't set the "Content-Type" header, so you probably want to do that on your own with n.rscottyŤSet the body of the response to the JSON encoding of the given value. Also sets "Content-Type" header to "application/json; charset=utf-8" if it has not already been set.sscotty„Set the body of the response to a Source. Doesn't set the "Content-Type" header, so you probably want to do that on your own with n.tscotty*Set the body of the response to the given Çb value. Doesn't set the "Content-Type" header, so you probably want to do that on your own with n.ČscottyxChecks if parameter is present and is null-valued, not a literal '()'. If the URI requested is: '/foo?bar=()&baz' then baz will parse as (), where bar will not.ÉscottyOverrides default Z to parse String.XYZĘ[\]^_`abcdefghijklmnopqrstNone=>?SXoÁ uscottyget = } Ëvscottypost = } Ěwscottyput = } Íxscotty delete = } Îyscottypatch = } Ďzscotty options = } Đ{scotty5Add a route that matches regardless of the HTTP verb.|scotty‚Specify an action to take if nothing else is found. Note: this _always_ matches, so should generally be the last route specified.}scottyDefine a route with a Ń, ś0 value representing the path spec, and a body (Action) which modifies the response. %addroute GET "/" $ text "beam me up!"RThe path spec can include values starting with a colon, which are interpreted as captures7. These are named wildcards that can be looked up with i. =addroute GET "/foo/:bar" $ do v <- param "bar" text v(curl http://localhost:3000/foo/something something~scottySMatch requests using a regular expression. Named captures are not yet supported. |get (regex "^/f(.*)r$") $ do path <- param "0" cap <- param "1" text $ mconcat ["Path: ", path, "\nCapture: ", cap]"curl http://localhost:3000/foo/barPath: /foo/barCapture: oo/bascotty”Standard Sinatra-style route. Named captures are prepended with colons. This is the default route type generated by OverloadedString routes. i.e. get (capture "/foo/:bar") $ ...and <{-# LANGUAGE OverloadedStrings #-} ... get "/foo/:bar" $ ...are equivalent.€scottyCBuild a route based on a function which can match using the entire Ä object. Ň' indicates the route does not match. A Óh value indicates a successful match, optionally returning a list of key-value pairs accessible by i. uget (function $ \req -> Just [("version", T.pack $ show $ httpVersion req)]) $ do v <- param "version" text vcurl http://localhost:3000/HTTP/1.1scottyOBuild a route that requires the requested path match exactly, without captures. uvwxyz{|}~€NoneSXƒü‚scottyNRun a scotty application using the warp server. NB: scotty p === scottyT p idƒscottysRun a scotty application using the warp server, passing extra options. NB: scottyOpts opts === scottyOptsT opts id„scotty¨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…scotty%Turn a scotty application into a WAI ÔJ, which can be run with any WAI handler. NB: scottyApp === scottyAppT id†scotty'Global handler for uncaught exceptions.kUncaught exceptions normally become 500 responses. You can use this to selectively override that behavior.$Note: IO exceptions are lifted into  s by !Ś. This has security implications, so you probably want to provide your own defaultHandler in production which does not send out the error strings as 500 responses.‡scottyŇUse given middleware. Middleware is nested such that the first declared is the outermost middleware (it has first dibs on the request and last action on the response). Every middleware is run on each request.‚scotty Run monad m into Ő, called at each action.ƒscotty Run monad m into Ő, called at each action.…scotty Run monad m into Ő, called at each action.< !"(2345XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡<‚…ƒ„2345‡uvwxyz}{|~€bdefgijhclmn`opqrst[\^]a† !"_XYZk(NoneSXé*,Šscotty/Run a scotty application using the warp server.‹scottyFRun a scotty application using the warp server, passing extra options.Œ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.scotty%Turn a scotty application into a WAI Ô), which can be run with any WAI handler.Žscotty'Global handler for uncaught exceptions.kUncaught exceptions normally become 500 responses. You can use this to selectively override that behavior.ćNote: IO exceptions are lifted into Scotty exceptions by default. This has security implications, so you probably want to provide your own defaultHandler in production which does not send out the error strings as 500 responses.scottyŇUse given middleware. Middleware is nested such that the first declared is the outermost middleware (it has first dibs on the request and last action on the response). Every middleware is run on each request.scotty-Throw an exception, which can be caught with ”4. Uncaught exceptions turn into HTTP 500 responses.‘scotty-Throw an exception, which can be caught with ”Q. Uncaught exceptions turn into HTTP responses corresponding to the given status.’scottyhAbort execution of this action and continue pattern matching routes. Like an exception, any code after ’ is not executed.nAs an example, these two routes overlap. The only way the second one will ever run is if the first one calls ’. Ëget "/foo/:bar" $ do w :: Text <- param "bar" unless (w == "special") next text "You made a request to /foo/special" get "/foo/:baz" $ do w <- param "baz" text $ "You made a request to: " <> w“scottyBAbort execution of this action. Like an exception, any code after “ is not executed.As an example only requests to  /foo/special8 will include in the response content the text message. |get "/foo/:bar" $ do w :: Text <- param "bar" unless (w == "special") finish text "You made a request to /foo/special" Since: 0.10.3”scottyCatch an exception thrown by . 0raise "just kidding" `rescue` (\msg -> text msg)•scottyLike liftIOC, but catch any IO exceptions and turn them into Scotty exceptions.–scottytRedirect 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"—scottyGet the Ä object.˜scottyGet list of uploaded files.™scotty6Get a request header. Header name is case-insensitive.šscotty?Get all the request headers. Header names are case-insensitive.›scottyGet the request body.œscotty'Get an IO action that reads body chunksThis is incompatible with › since › consumes all chunks.scottydParse the request body as a JSON object and return it. Raises an exception if parse is unsuccessful.žscottyPGet 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 Ĺ% 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.Ÿscotty@Get all parameters from capture, form and query (in that order). scotty-Set the HTTP response status. Default is 200.Ąscotty?Add to the response headers. Header names are case-insensitive.˘scotty|Set one of the response headers. Will override any previously set value for that header. Header names are case-insensitive.Łscotty*Set the body of the response to the given śg value. Also sets "Content-Type" header to "text/plain; charset=utf-8" if it has not already been set.¤scotty*Set the body of the response to the given śf value. Also sets "Content-Type" header to "text/html; charset=utf-8" if it has not already been set.ĽscottyvSend a file as the response. Doesn't set the "Content-Type" header, so you probably want to do that on your own with ˘.ŚscottyŤSet the body of the response to the JSON encoding of the given value. Also sets "Content-Type" header to "application/json; charset=utf-8" if it has not already been set.§scotty‹Set the body of the response to a StreamingBody. Doesn't set the "Content-Type" header, so you probably want to do that on your own with ˘.¨scotty*Set the body of the response to the given a value. Doesn't set the "Content-Type" header, so you probably want to do that on your own with ˘.Šscottyget = ą GETŞscottypost = ą POSTŤscottyput = ą PUTŹscotty delete = ą DELETE­scottypatch = ą PATCHŽscotty options = ą OPTIONSŻscotty5Add a route that matches regardless of the HTTP verb.°scotty‚Specify an action to take if nothing else is found. Note: this _always_ matches, so should generally be the last route specified.ąscottyDefine a route with a Ń, ś0 value representing the path spec, and a body (Action) which modifies the response. %addroute GET "/" $ text "beam me up!"RThe 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˛scottySMatch requests using a regular expression. Named captures are not yet supported. |get (regex "^/f(.*)r$") $ do path <- param "0" cap <- param "1" text $ mconcat ["Path: ", path, "\nCapture: ", cap]"curl http://localhost:3000/foo/barPath: /foo/barCapture: oo/bałscotty”Standard Sinatra-style route. Named captures are prepended with colons. This is the default route type generated by OverloadedString routes. i.e. get (capture "/foo/:bar") $ ...and <{-# LANGUAGE OverloadedStrings #-} ... get "/foo/:bar" $ ...are equivalent.´scottyCBuild a route based on a function which can match using the entire Ä object. Ň' indicates the route does not match. A Óh value indicates a successful match, optionally returning a list of key-value pairs accessible by ž. sget (function $ \req -> Just [("version", pack $ show $ httpVersion req)]) $ do v <- param "version" text vcurl http://localhost:3000/HTTP/1.1ľscottyOBuild a route that requires the requested path match exactly, without captures.92345XYZkˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľ9Š‹Œ2345ŠŞŤŹ­ŽąŻ°ł˛´ľ—™š›œžŸ˜ Ą˘–٤ĽŚ§¨‘”’“Ž•XYZk‰ˆÖ       !"#$%&'()*+,-*../001234566789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‰Š^_`dabcefghijklmopqrstuvwxyz{|}~€‚ƒ„‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§˘¨Š˘ŞŤŹ­ŽŻ°ą˛łą˛´ą˛ľą˛śą˛ˇą˛¸ą˛š˘şť˘şźĽ˝4žżŔÁ"scotty-0.12-AOQLnxXpNu7HKrORd27yW3Web.Scotty.Internal.TypesWeb.Scotty.Trans Web.ScottyWeb.Scotty.UtilWeb.Scotty.ActionWeb.Scotty.RouteBL ByteString RoutePatternCaptureLiteralFunctionActionTrunAMScottyResponseSRsrStatus srHeaders srContentContentContentBuilder ContentFile ContentStreamBodyPartiallyStreamedRequestBodyState BodyUntouched BodyCached BodyCorrupted ActionEnvEnvgetReq getParamsgetBody getBodyChunkgetFilesFileParam ErrorHandler ScottyError stringError showError ActionErrorRedirectNextFinishScottyTrunS ScottyState middlewaresrouteshandler Application MiddlewareOptionsverbosesettings addMiddlewareaddRoute addHandler$fDefaultOptions$fScottyErrorActionError$fScottyErrorText $fExceptionBodyPartiallyStreamed$fDefaultScottyResponse$fMonoidActionT$fSemigroupActionT$fMonadStatesActionT$fMonadReaderrActionT$fMonadBaseControlbActionT$fMonadTransControlActionT$fMonadCatchActionT$fMonadThrowActionT$fMonadBasebActionT$fMonadErrorActionErrorActionT$fMonadTransActionT$fMonadPlusActionT$fAlternativeActionT$fMonadFailActionT$fMonadActionT$fDefaultScottyState$fMonoidScottyT$fSemigroupScottyT$fIsStringRoutePattern$fShowBodyPartiallyStreamed$fFunctorActionT$fApplicativeActionT$fMonadIOActionT$fFunctorScottyT$fApplicativeScottyT$fMonadScottyTParsable parseParamparseParamListraise raiseStatusnextrescueliftAndCatchIOredirectfinishrequestfilesheaderheadersbody bodyReaderjsonDataparamparams readEitherstatus addHeader setHeadertexthtmlfilejsonstreamrawgetpostputdeletepatchoptionsmatchAnynotFoundaddrouteregexcapturefunctionliteralscottyT scottyOptsT scottySocketT scottyAppTdefaultHandler middlewareActionMScottyMscotty scottyOpts scottySocket scottyApp text-1.2.3.1Data.Text.Internal.LazyText"warp-3.3.11-IU6c5BsLm4d4RgVnZApjjz!Network.Wai.Handler.Warp.SettingsSettingslazyTextToStrictByteStringstrictByteStringToLazyText setContent setHeaderWith setStatus mkResponsereplaceaddaddIfNotPresentsocketDescriptiondefHbaseControl.Monad.IO.ClassliftIO"wai-3.2.2.1-JvsnCNzwPSIGr3rEVcANLINetwork.Wai.InternalRequest Text.ReadreadGHC.ReadReadbytestring-0.10.8.2Data.ByteString.Lazy.Internal $fParsable()$fParsableChar runAction(http-types-0.12.3-A2cx1Lg5j0cKG76Sfj8L06Network.HTTP.Types.MethodGETPOSTPUTDELETEPATCHOPTIONS StdMethod GHC.MaybeNothingJust Network.Waighc-prim GHC.TypesIO