mercredi 2 mars 2016

Rendering simple text with Swift Express

Does anybody know how to render simple text (without using any template) in Swift Express? I can't find that in their documentation.

I want to have some function like this:

app.get("/") { (request:Request<AnyContent>)->Action<AnyContent> in
    return Action<AnyContent>.render(html: "<html><body>This is a simple html</body></html>")
}

And get string "This is a simple HTML" in browser (surrounded by the tags, of course)

Thanks a lot for the help!




Aucun commentaire:

Enregistrer un commentaire