scotty-path-normalizer alternatives and similar packages
Based on the "scotty" category.
Alternatively, view scotty-path-normalizer alternatives based on common mentions on social networks and blogs.
10.0 4.1 scotty-path-normalizer VS scottyHaskell web framework inspired by Ruby's Sinatra, using WAI and Warp (Official Repository)
Integrating Hastache templates into Scotty
The Play Framework style data binding in Scotty.
Do you think we are missing an alternative of scotty-path-normalizer or a related project?
Scotty path normalizer
This library provides a Scotty action that normalizes the HTTP request target as if it were a Unix file path. When the path normalization action detects a path that can be simplified in one of the following ways, it issues a redirect to a more canonical path.
- Remove trailing slashes:
- Remove double slashes:
.represents "the current directory":
- Remove segments of the form
..represents "the parent directory":
The typical way to apply this to your Scotty server is to put
addPathNormalizer at the top of your
ScottyM app definition.
import qualified Web.Scotty as Scotty import Web.Scotty.PathNormalizer (addPathNormalizer) main :: IO () main = Scotty.scotty 3000 $ do addPathNormalizer Scotty.get (Scotty.capture "/:word") $ do beam <- Scotty.param (Data.Text.Lazy.pack "word") Scotty.html $ fold [ Data.Text.Lazy.pack "<h1>Scotty, " , beam , Data.Text.Lazy.pack " me up!</h1>" ]