title: How to call a server side function from client side (e.g. html button onclick) in Node.js?
body: <p>I need a complete basic example in Node.js of calling a server-side function from (client side) html button onclick event, just like in ASP.NET and C#. </p>
  
  <p>I am new to Node.js and using the Express framework.</p>
  
  <p>Any help?</p>
  
  <p>IMPROVED QUESTION:</p>
  
  <p>//server side :</p>
  
  <pre><code>var express = require('express');
  var routes = require('./routes');
  var user = require('./routes/user');
  var http = require('http');
  var path = require('path');
  var app = express();
  
  // all environments
  
  app.set('views',__dirname + '/views');
  app.set('port', process.env.PORT || 3000);
  app.engine('html', require('ejs').renderFile);
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(express.static(path.join(__dirname, 'public')));
  app.set('view engine', 'html');
  
  app.use(app.router);
  
  app.get("/",function(req,res)
  {
    res.render('home.html');
  });
  
  
  // development only
  if ('development' == app.get('env')) {
    app.use(express.errorHandler());
  }
  
  app.get('/', routes.index);
  app.get('/users', user.list);
  
  http.createServer(app).listen(app.get('port'), function(){
    console.log('Express server listening on port ' + app.get('port'));
  });
  </code></pre>
  
  <p>//Client Side</p>
  
  <pre><code> &lt;input type="button" onclick="" /&gt;  &lt;--just want to call the serverside function from here--&gt;
  </code></pre>