title: NodeJS Create text file from string and send back to client
body: <p>I tried </p>
  
  <pre><code>var text={"hello.txt":"Hello World!","bye.txt":"Goodbye Cruel World!"};
  app.get('/files/:name',function(req,res){
  res.set("Content-Type","text/plain");
  res.send(text[req.params.name]);
  });
  </code></pre>
  
  <p>and this is my client ajax call</p>
  
  <pre><code>$.ajax({
                      type: verb || 'GET',
                      dataType: "text",
                      url: url,
                      data: data,
                      contentType : 'text/plain',
                      success: function () { $('div#callForm button').removeAttr('disabled'); },
                      error: alert
                  });
  </code></pre>
  
  <p>However no file is returning to be downloaded.</p>
  
  <p>Can someone point me in the right direction?</p>