Guest User

Untitled

a guest
Nov 11th, 2016
165
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var http = require('http');
  2. var express = require('express');
  3. var fs = require('fs');
  4. var bodyParser = require('body-parser');
  5.  
  6. var app = express();
  7.  
  8. app.use('/',express.static(__dirname + '/'));
  9. app.use(bodyParser.urlencoded({ extended: false }));
  10. app.engine('.html', require('ejs').__express);
  11. app.set('view engine','html');
  12.  
  13.  
  14. app.get('/', function(req, res){
  15. res.render('index');
  16. });
  17.  
  18. app.get('/resume', function(req, res){
  19. res.render('resume');
  20. });
  21.  
  22. app.get('/contact', function(req, res){
  23. res.render('contact');
  24. });
  25.  
  26. app.use(function(req, res) {
  27. res.status(404).render('404');
  28. });
  29.  
  30. app.listen(3000, function () {
  31. console.log('Listening on port 3000!');
  32. });
RAW Paste Data