summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2014-06-08 12:22:59 -0400
committerJulie Lala <jules@okfoc.us>2014-06-08 12:22:59 -0400
commitd385f80d0942494410432f11d3f3ca0f05d9e4a9 (patch)
tree013c274d1311b58f3f9ea9c4716ce5e2124a60ce /server
parent6dc5e91ebf84181bc8ca1057d5338296d918931c (diff)
new views and redirection logic
Diffstat (limited to 'server')
-rw-r--r--server/index.js6
-rw-r--r--server/lib/views.js12
2 files changed, 13 insertions, 5 deletions
diff --git a/server/index.js b/server/index.js
index 05d353d..fc77660 100644
--- a/server/index.js
+++ b/server/index.js
@@ -60,7 +60,8 @@ app.all('*', middleware.ensureLocals);
// Initialize views
app.get('/', views.home);
-app.get('/login', views.login);
+app.get('/login', views.modal);
+app.get('/signup', views.modal);
app.post('/auth/signin', auth.loggedIn('local'));
app.post('/auth/signup', auth.signup);
app.get('/logout', auth.logout);
@@ -70,6 +71,9 @@ app.get('/auth/facebook', auth.login('facebook'));
app.get('/auth/facebook/callback', auth.loggedIn('facebook'));
app.get('/profile', views.profile)
app.get('/profile/edit', views.profile)
+
+app.get('/project/new', views.modal);
+
app.get(/^\/([-_a-zA-Z0-9]+)\/?$/, views.profile)
diff --git a/server/lib/views.js b/server/lib/views.js
index a8723eb..4f2402b 100644
--- a/server/lib/views.js
+++ b/server/lib/views.js
@@ -5,17 +5,19 @@ var User = require('./schemas/User'),
config = require('../../config'),
_ = require('lodash');
-exports.login = function (req, res) {
- res.render('login', {
+var views = {}
+
+views.modal = function (req, res) {
+ res.render('modal', {
});
};
-exports.home = function (req, res) {
+views.home = function (req, res) {
res.render('home', {
})
}
-exports.profile = function (req, res) {
+views.profile = function (req, res) {
var username = req.params[0]
if (username) {
User.findOne({ username: username }, function (err, user) {
@@ -43,3 +45,5 @@ exports.profile = function (req, res) {
})
}
}
+
+module.exports = views