Guest User

Untitled

a guest
Jan 21st, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. server.js
  2. =====================================
  3. var app = express.createServer();
  4.  
  5. app.configure(function(){
  6. app.use(express.methodOverride());
  7. app.use(express.bodyParser());
  8. app.set('view engine', 'html');
  9. app.register('.html', require('jqtpl'));
  10. });
  11.  
  12. app.post('/login', function(req, res, next){
  13. console.dir(req.body);
  14. });
  15.  
  16. ...
  17.  
  18.  
  19. login.html
  20. =====================================
  21. <form action="/login" method="post" accept-charset="utf-8">
  22. <label for="login">Login</label>
  23. <input type="text" name="[user]login" id="login" value="" />
  24. <label for="password">Password</label>
  25. <input type="password" name="[user]password" id="password" value="" />
  26. <input type="submit" name="submit" value="Log in">
  27. </form>
Add Comment
Please, Sign In to add comment