docs icon indicating copy to clipboard operation
docs copied to clipboard

Document PlaintextRenderer and viewsDirectory

Open erf opened this issue 5 years ago • 0 comments

I recently tried to render a .html file in a route in Vapor 4 and did not find any documentation on it except from on an stackoverflow answer. The community recommended to create an issue.

I got it working by using the PlainTextRenderer

    app.get { req in
        req.view.render("index.html")
    }

and by adding the resourcesDirectory/viewsDirectory

{ProjectPath}/Resources/Views/index.html

I suggest documenting both the PlainTextRenderer and the resourcesDirectory / viewsDirectory.

erf avatar Sep 29 '20 08:09 erf