-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.js
57 lines (41 loc) · 1.39 KB
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var stormpath = require('express-stormpath');
var profile = require('./apis/profile.js');
var blog = require('./apis/blog.js');
module.exports = function (app) {
var data = {
'title' : 'Sognare'
};
app.get('/', stormpath.getUser, function(req, res) {
data.user = req.user == undefined ? "" : req.user;
res.render('home', data);
});
app.get('/home', stormpath.getUser, function(req, res) {
data.user = req.user == undefined ? "" : req.user;
res.render('home', data);
});
app.get('/blog', stormpath.getUser, function(req, res) {
data.user = req.user == undefined ? "" : req.user;
res.render('blog_create', data);
});
app.get('/timeline', stormpath.getUser, function(req, res) {
data.user = req.user == undefined ? "" : req.user;
res.render('timeline', data);
});
app.get('/blog_view', stormpath.getUser, function(req, res) {
data.user = req.user == undefined ? "" : req.user;
res.render('blog_view', data);
});
app.get('/about', stormpath.getUser, function(req, res) {
data.user = req.user == undefined ? "" : req.user;
res.render('contactus', data);
});
app.post('/blog/new_blog', stormpath.loginRequired, function (req, res) {
blog.newBlog(req, res);
});
web(app);
api(app);
};
function web(app) {
};
function api(app) {
};