]> git.cworth.org Git - nodemuch/blob - example.js
Initial notmuch web client
[nodemuch] / example.js
1 var http = require( "http" ),
2     exec = require( "child_process" ).exec,
3     notmuch;
4
5 http.createServer( function(req, res) {
6         var q = "wiki";
7         notmuch = exec( "notmuch search " + q, function( error, stdout, stderr ) {
8           res.writeHead( 200, { "Content-Type": "text/plain" } );
9           res.end( stdout );      
10         });
11 } ).listen( 8124, "127.0.0.1" );
12 console.log( "Server running at http://127.0.0.1:8124/" );