Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jan 4th, 2013  |  syntax: None  |  size: 0.96 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var app = express();
  2. var port = process.env.PORT || 1337;
  3.  
  4.  
  5. app.use('/i', express.static(__dirname + '/i'));
  6. app.use('/Stylesheets', express.static(__dirname + '/Stylesheets'));
  7. app.use(express.static(__dirname));
  8.  
  9.  
  10. app.listen(port);
  11. console.log('listening on port ' +  port);
  12.        
  13. var data  = {"name":"John"};
  14. var result = templateEngine.bind("/template.html", data)
  15.  
  16.  
  17. $('.person').html(result);
  18.        
  19. <div class="person">
  20.     My Name is FirstName
  21. </div>
  22.        
  23. app.**[HTTP VERB]**(**[URL]**, function(req, res){
  24.     res.end('<html>hello world</html>');
  25. });
  26.        
  27. app.get('/', function(req, res){
  28.     res.end('<html>hello world</html>');
  29. });
  30.        
  31. app.get('/test', function(req, res){
  32.     res.end('<html>hello world from the test folder</html>');
  33. });
  34.        
  35. app.post('/test', function(req, res){
  36.     res.end('<html>Thanks for submitting your info</html>');
  37. });
  38.        
  39. app.get('/test', routes.NameOfFunctionToHandleGetForSlashTest);
  40. app.post('/test', routes.NameOfFunctionToHandlePostForSlashTest);