Browse Source

Add plaintext test

Patrick Falls 12 years ago
parent
commit
993bfaa4b2
2 changed files with 9 additions and 1 deletions
  1. 1 0
      nodejs/benchmark_config
  2. 8 1
      nodejs/hello.js

+ 1 - 0
nodejs/benchmark_config

@@ -4,6 +4,7 @@
     "default": {
       "setup_file": "setup",
       "json_url": "/json",
+      "plaintext_url": "/plaintext",
       "port": 8080,
       "sort": 8
     },

+ 8 - 1
nodejs/hello.js

@@ -79,7 +79,7 @@ function sequelizeQuery(callback) {
 http.createServer(function (req, res) {
   // JSON response object
   var hello = {message: "Hello, world"};
-
+  var helloStr = "Hello, World!";
   var path = url.parse(req.url).pathname;
   
   // mysql on windows is not supported
@@ -95,6 +95,13 @@ http.createServer(function (req, res) {
     res.end(JSON.stringify(hello));
     break;
 
+  case '/plaintext':
+    // JSON Response Test
+    res.writeHead(200, {'Content-Type': 'text/plain; charset=UTF-8'});
+    // Write JSON object to response
+    res.end(helloStr);
+    break;
+
   case '/mongodbdriver':
     // Database Test
     var values = url.parse(req.url, true);