Tags config, files protocol, and context passing
Pre-release
Pre-release
This patch was authored and released by @tanner0101.
Adds new Leaf configuration options, including custom tags, to application.
app.leaf.tags["foo"] = FooTag()
app.leaf.files = TestFiles()
app.leaf.configuration.rootDirectory = "/"
Adds support for passing Request
and Application
to LeafKit's userInfo storage.
struct FooTag: LeafTag {
func render(_ context: LeafContext) throws -> LeafData {
context.request // Request?
context.application // Application?
...
}
}
These will be set automatically when using app.view
or req.view
.