title: execute a Nodejs script from an html page?
body: <p>I am currently using <a href="http://expressjs.com/" rel="noreferrer">Express.js</a> to create my website.
  My main server script is called <code>index.coffee</code>. I also created a script called <code>request.js</code> that makes a GET request and displays the response with</p>
  
  <pre><code>  console.log(list);
  </code></pre>
  
  <p>I have no problems when running the script from the console: <code>node request.js</code></p>
  
  <p>My question is: How do I make the "Get this list" button on my the page respond to a click by displaying the list on the same page (that is, executing <code>request.js</code> on the server and showing the result)?</p>
  
  <p>app.js</p>
  
  <pre><code>/**
   * Module dependencies.
   */
  
  var express = require('express')
    , routes = require('./routes');
  
  var app = module.exports = express.createServer();
  
  // Configuration
  
  app.configure(function(){
    app.set('views', __dirname + '/views');
    app.set ('view engine', 'coffee');
  app.register('.coffee', require('coffeekup').adapters.express);
  
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(express.static(__dirname + '/public'));
  });
  
  app.configure('development', function(){
    app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
  });
  
  app.configure('production', function(){
    app.use(express.errorHandler());
  });
  
  app.get('/', function(req, res) {
    res.render('index',{ layout: false });
  });
  
  
  
  app.listen(3000);
  console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
  </code></pre>
  
  <p>index.coffee</p>
  
  <pre><code>doctype 5
  html -&gt;
  
    head -&gt;
      body
  </code></pre>
  
  <p>p -> "hey"</p>