diff --git a/app.js b/app.js index fec126b..7e5dd25 100644 --- a/app.js +++ b/app.js @@ -14,9 +14,6 @@ var express = require('express'), var app = express(); -// connect to the database - - app.configure(function(){ app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); diff --git a/models/db.js b/models/db.js index bb57c92..7c3e87b 100644 --- a/models/db.js +++ b/models/db.js @@ -87,5 +87,4 @@ function buildDB() { return db; } -exports.models = connectTo(config.dbhost, config.dbname, config.dbuser, config.dbpassword, config.dbport).models; -console.log(exports.models); \ No newline at end of file +exports.models = connectTo(config.dbhost, config.dbname, config.dbuser, config.dbpassword, config.dbport).models; \ No newline at end of file diff --git a/routes/index.js b/routes/index.js index a5c3078..eebac87 100644 --- a/routes/index.js +++ b/routes/index.js @@ -6,11 +6,11 @@ var db = require('./../models/db'); exports.index = function(req, res){ - res.render('index', { title: 'Home'}); + res.render('index', { title: 'Home', scripts: []}); }; exports.showSignup = function(req, res) { - res.render('signup', {title: 'Signup', errors: [] }) + res.render('signup', {title: 'Signup', errors: [], scripts: ['javascripts/signup.js'] }) } exports.processSignup = function(req, res) { @@ -32,7 +32,6 @@ exports.processSignup = function(req, res) { errors.push(err); } - res.render('signup', {title: 'Signup Successful', errors: errors }); - }) - -} \ No newline at end of file + res.render('signup', { title: 'Signup Successful', errors: errors, scripts: ['javascripts/signup.js'] }); + }); +}; \ No newline at end of file diff --git a/views/footer.ejs b/views/footer.ejs index 7fdbb03..3731aca 100644 --- a/views/footer.ejs +++ b/views/footer.ejs @@ -1,4 +1,10 @@ + + + <%= scripts %> + <% for(var i = 0; i < scripts.length; i++) { %> + + <% } %> \ No newline at end of file diff --git a/views/signup.ejs b/views/signup.ejs index a735a16..ded3753 100644 --- a/views/signup.ejs +++ b/views/signup.ejs @@ -4,13 +4,13 @@ <% } else { %>

Thank you for signing up, you are awesome :).

<% } %> -
+ - + - +
<%- include footer %>