Hi Hannes,
You can find some examples in the Enterprise Pharo book
(http://files.pharo.org/books/enterprise-pharo/).
Teapot on
GET: '/greet' -> {'phrase' -> 'Hello'. 'name' -> 'World'};
output: (TeaOutput mustacheHtml: '<html>*{{phrase}}*
/{{name}}/!</html>');
start.
The {'phrase' -> 'Hello'. 'name' -> 'World'} servers as a model for the
template engine. Imagine that this was returned by some domain logic.
Anyway my preferred way of using Teapot is to use it as a REST (-like)
backend and consume/produce JSON (or whatever) objects, instead of
generating HTMLS on the server side via Mustache.
Attila
--
View this message in context:
http://forum.world.st/Teapot-and-Mustache-in-Pharo-6-tp4963156p4963167.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.