From: Richard Worth <rdworth@gmail.com>
Date: Sun, 5 Dec 2010 10:18:32 +0000 (-0800)
Subject: Initial notmuch web client
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=7cce7aad03f20ee68e059bc6e84c07890485bb48;p=nodemuch

Initial notmuch web client

It doesn't do much yet. It just shows the output of a hard-coded
notmuch search using child process exec of 'notmuch search'.
---

7cce7aad03f20ee68e059bc6e84c07890485bb48
diff --git a/example.js b/example.js
new file mode 100644
index 0000000..e6a084b
--- /dev/null
+++ b/example.js
@@ -0,0 +1,12 @@
+var http = require( "http" ),
+    exec = require( "child_process" ).exec,
+    notmuch;
+
+http.createServer( function(req, res) {
+	var q = "wiki";
+	notmuch = exec( "notmuch search " + q, function( error, stdout, stderr ) {
+	  res.writeHead( 200, { "Content-Type": "text/plain" } );
+	  res.end( stdout );	  
+	});
+} ).listen( 8124, "127.0.0.1" );
+console.log( "Server running at http://127.0.0.1:8124/" );