var sys = require("sys"),
  http = require('http'),
  url = require('url'),
  crc = require('./crc32');

var debug = true;

var shard_map = {
  'nodes': ['http://localhost:5984/', 'http://localhost:5984/'],
  'shards': [[0,1], [1,0]]
};

//dbname -> dbname$0, etc. Change for loop-back replication resharding.
var shard_index_sep = '$';

handle_request = function(client_request, client_response) {
  request_url_parsed = url.parse(client_request.url, true);
  path_parts = request_url_parsed['pathname'].match(/[^\/$]+/g);
  client_response.sendHeader(200, {"Content-Type": "text/plain"});
  client_response.sendBody("Check back soon...");
  client_response.finish();
};

http.createServer(
  function(request, response) {
	try {
	  handle_request(request, response);
	} catch(err) {
	  response.sendHeader(500, {"Content-Type": "text/plain"});
	  response.sendBody("Internal Server Error\n");
	  if(debug) {
		response.sendBody(err.stack);
	  }
	  response.finish();
	}
  }
).listen(6984);
sys.puts("Server running at http://127.0.0.1:6984/");

@@ -98,16 +98,39 @@
 c32');%0A%0A
+var version = %220.0.1%22;%0A
 var debu
@@ -540,18 +540,38 @@
 $%5D+/g);%0A
+%0A
   
+if(!path_parts) %7B%0A%09
 client_r
@@ -627,16 +627,220 @@
 ain%22%7D);%0A
+%09client_response.sendBody(%22lode version %22 + version);%0A%09client_response.finish();%0A%09return;%0A  %7D%0A%0A  switch(path_parts.length) %7B%0A%09default:%0A%09  client_response.sendHeader(200, %7B%22Content-Type%22: %22text/plain%22%7D);%0A%09
   client
@@ -881,16 +881,17 @@
 n...%22);%0A
+%09
   client
@@ -910,16 +910,20 @@
 nish();%0A
+  %7D%0A
 %7D;%0A%0Ahttp

add version number, / path and 'coming soon' message for others