Guest User

Untitled

a guest
Jan 4th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  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);
Add Comment
Please, Sign In to add comment