1. Patrick Veverka
  2. oscarnode

Commits

Patrick Veverka  committed bc7aac7

iles

  • Participants
  • Parent commits cfff351
  • Branches default

Comments (0)

Files changed (2)

File app.js

View file
  • Ignore whitespace
 // Configuration
 
 app.configure(function(){
+  app.use(express.logger({ format: ':method :url' }));
   app.set('views', __dirname + '/views');
   app.set('view engine', 'jade');
   app.use(express.bodyParser());

File routes/index.js

View file
  • Ignore whitespace
  */
 
 exports.index = function(req, res){
-	console.log("RENDERING");
-	var mysql = require('mysql');
-	var TEST_DATABASE = 'nodejs_mysql_test';
-	var TEST_TABLE = 'test';
-	var client = mysql.createClient({
-	  user: 'root',
-	  password: 'p@ssw0rd!',
-	});
-
-	client.query('CREATE DATABASE '+TEST_DATABASE, function(err) {
-	  if (err && err.number != mysql.ERROR_DB_CREATE_EXISTS) {
-	    throw err;
-	  }
-	});
   res.render('index', { title: 'Oscar Page' })
 };