Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. var express = require('express');
  2. var bodyParser = require('body-parser');
  3. var app = express();
  4. var fs = require('fs');
  5.  
  6. var mysql = require('mysql');
  7.  
  8. var connection = mysql.createConnection({
  9. host: 'localhost',
  10. user: 'root',
  11. password: 'root',
  12. database: 'NotFB'
  13. });
  14.  
  15. connection.connect(function(err){
  16. if(err) throw err;
  17. console.log('you are now connected... ');
  18.  
  19. })
  20. ;
  21. app.use(bodyParser.json());
  22. app.use(bodyParser.urlencoded({
  23. extended: true
  24. }));
  25.  
  26. app.use(express.static(__dirname + '/public'));
  27.  
  28.  
  29.  
  30. app.listen(10001, "0.0.0.0",function() {
  31. //var host = server.address();
  32. console.log('server listening on port ' + 10001);
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement