SHARE
TWEET

NodeJS : Server untuk Menampilkan Halaman Web

stevennathaniel Jun 22nd, 2016 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Created by StevenNathaniel on 23-Jun-16.
  3.  */
  4. var express = require('express');
  5.  
  6. var app = express();
  7.  
  8. var path = require('path');
  9.  
  10. var pug = require('pug');
  11.  
  12. var bodyParser = require('body-parser');
  13.  
  14. var fs = require('fs');
  15.  
  16. app.set('view engine','pug');
  17. app.set('views',__dirname + '/views');
  18. app.use(bodyParser.urlencoded({extended: true}));
  19.  
  20. app.get('/', function(req, res) {
  21.     res.render("halaman3.pug");
  22. });
  23.  
  24. app.listen(3000);
  25. console.log("server berjalan di localhost port 3000");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top