SHARE
TWEET

Express : Rumus Utama Form Post

stevennathaniel Jun 20th, 2016 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Created by StevenNathaniel on 20-Jun-16.
  3.  */
  4.  
  5. var express = require('express');
  6. var app =  express();
  7. var path = require("path");
  8. var pug = require('pug');
  9. var bodyParser = require('body-parser');
  10.  
  11. app.use(bodyParser.urlencoded({extended: true}));
  12.  
  13. app.get('/', function(req, res) {
  14.     res.sendFile(path.join(__dirname + '/halaman1.html'));
  15. });
  16.  
  17. app.post('/', function(req, res) {
  18.     console.log(req.body.namaawal);
  19. });
  20.  
  21. app.listen(3000);
  22. 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