Featured Posts

  • Prev
  • Next

Helma, CouchDB and JSTAL

Posted on : 27-01-2008 | By : Pawel Knapik | In : EN, web development

Tags: , , ,

0

I’ve been playing with my JSTAL and Helma+CouchDB – and it seems to work really well!
Here’s a short Helma code example:


app.addRepository("modules/jstal/jstal.js");
app.addRepository("modules/helma/Http.js");
app.addRepository("modules/core/JSON.js");

global.dbData =
helma.Http().getUrl('http://localhost:5984/test/_all_docs')
.content.parseJSON();

var template =
<ul xmlns:tal="http://xml.zope.org/namespaces/tal">
	<li tal:repeat="row dbData/rows">
		<em  tal:content="string: id = ${row/id}" />
	</li>
</ul>;

res.write( jstal(template).render() )

Write a comment