title: Using POST data to write to local file with node.js and express
body: <p>I'm trying to just handle simple POST requests and append the data to a local file. However, when I try to POST raw text with <a href="https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en" rel="noreferrer">postman</a>, such as 'hi world', what's actually appended is <code>[object Object]</code>. I'm not sure what could be causing this if nothing should be interpreted as an object on either end. Thank you!</p>
  
  <pre><code>var express = require('express'),
      fs = require('fs')
      url = require('url');
  var app = express();
  
  app.configure(function(){
    app.use('/public', express.static(__dirname + '/public'));  
    app.use(express.static(__dirname + '/public')); 
    app.use(express.bodyParser());
  });
  
  app.post('/receive', function(request, respond) {
      filePath = __dirname + '/public/data.txt';
      fs.appendFile(filePath, request.body, function () {
          respond.end();
      });
  });
  
  app.listen(8080);
  </code></pre>