Monday, August 25, 2014

Teapot - another way for Pharo to serve the web

There are various options to write web applications in Pharo. You can use Seaside or Aida web framework or play with the new Tide framework connecting Amber with Pharo.

If you want to quickly write something you can use the plain Zn framework as this nice tutorial from Sven describes.

And now there is something inbetween that allow you to quickly write an application that serves static or dynamic content from Pharo. It is called Teapot and with a few lines of code you can provide JSON to the outside world or other REST based functionality. It also includes support for the Pharo port of Mustache (the templating engine).

The basic concept of Teapot is to define one or many URL Route(s) - either direct or as pattern (for instance with a Regexpression) and return an appropriate response from the Smalltalk side. Simple, lightweight and easy to use.

No comments: