Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|
Routing functionality.
- directory :: Text -> WebWire site a b -> WebWire site a b
- file :: Text -> WebWire site a b -> WebWire site a b
- rootDir :: WebWire site a b -> WebWire site a b
- redirect :: RedirectType -> WebWire site Text b
- redirectRaw :: RedirectType -> WebWire site Text b
- seeOther :: WebWire site Text b
- seeOtherRaw :: WebWire site Text b
- cdIn :: WebWire site a ()
- cdOut :: WebWire site a ()
- currentDir :: WebWire site a (Maybe Text)
- currentPath :: WebWire site a [Text]
- pathAbs :: WebWire site [Text] Text
- pathRel :: WebWire site [Text] Text
- requestDir :: WebWire site a (Maybe Text)
- requestPath :: WebWire site a [Text]
- rootPath :: WebWire site a [Text]
- setRoot :: WebWire site [Text] ()
Routing
directory :: Text -> WebWire site a b -> WebWire site a bSource
If the request root segment is the given directory, then removes the root segment and adds it to the current path for the given wire.
file :: Text -> WebWire site a b -> WebWire site a bSource
If the request root segment is the given file and there are no more segments, then removes the last segment and adds it to the current path for the given wire.
rootDir :: WebWire site a b -> WebWire site a bSource
Run the given wire, if the current request path is empty. Otherwise inhibit with 404.
Redirecting
redirect :: RedirectType -> WebWire site Text bSource
Redirect to the input URI. Inhibits with the appropriate exception.
redirectRaw :: RedirectType -> WebWire site Text bSource
Redirect to the input URI. Inhibits with the appropriate exception.
seeOther :: WebWire site Text bSource
Convenience interface to redirect
for the very common 303
redirection.
seeOtherRaw :: WebWire site Text bSource
Convenience interface to redirect
for the very common 303
redirection.
Paths
cdIn :: WebWire site a ()Source
Remove the root request segment and add it to the current path. Inhibits with a 404 error, if the request path is empty.
cdOut :: WebWire site a ()Source
Remove the current tail segment and add it to the request path. Inhibits with a 404 error, if the current path is empty.
currentDir :: WebWire site a (Maybe Text)Source
currentPath :: WebWire site a [Text]Source
Output the current rest of the path segment.
pathAbs :: WebWire site [Text] TextSource
Construct the full URI to the given path from the root path.
pathRel :: WebWire site [Text] TextSource
Construct the full URI to the given path from the current path.
requestDir :: WebWire site a (Maybe Text)Source
requestPath :: WebWire site a [Text]Source
Output the rest of the request path segment.