1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-20 18:51:29 +00:00

Styled the homepage a bit better

This commit is contained in:
Scott Tolksdorf
2016-01-11 14:39:01 -05:00
parent c359805679
commit 9bc2eb70b2
3 changed files with 68 additions and 47 deletions

View File

@@ -12,31 +12,6 @@ module.exports = function(app){
})
//Edit Page
app.get('/homebrew/edit/:id', function(req, res){
HomebrewModel.find({editId : req.params.id}, function(err, objs){
var resObj = null;
var errObj = {text: "# oops\nCould not find the homebrew."}
if(objs.length){
resObj = objs[0];
}
vitreumRender({
page: './build/homebrew/bundle.dot',
globals:{},
prerenderWith : './client/homebrew/homebrew.jsx',
initialProps: {
url: req.originalUrl,
entry : resObj || errObj
},
clearRequireCache : true,
}, function (err, page) {
return res.send(page)
});
})
});
//Updating
app.put('/homebrew/update/:id', function(req, res){
HomebrewModel.find({editId : req.params.id}, function(err, objs){
@@ -68,6 +43,32 @@ module.exports = function(app){
//Edit Page
app.get('/homebrew/edit/:id', function(req, res){
HomebrewModel.find({editId : req.params.id}, function(err, objs){
var resObj = null;
var errObj = {text: "# oops\nCould not find the homebrew."}
if(objs.length){
resObj = objs[0];
}
vitreumRender({
page: './build/homebrew/bundle.dot',
globals:{},
prerenderWith : './client/homebrew/homebrew.jsx',
initialProps: {
url: req.originalUrl,
brew : resObj || errObj
},
clearRequireCache : true,
}, function (err, page) {
return res.send(page)
});
})
});
//Share Page
app.get('/homebrew/share/:id', function(req, res){
HomebrewModel.find({shareId : req.params.id}, function(err, objs){
@@ -87,7 +88,7 @@ module.exports = function(app){
prerenderWith : './client/homebrew/homebrew.jsx',
initialProps: {
url: req.originalUrl,
entry : resObj || errObj
brew : resObj || errObj
},
clearRequireCache : true,
}, function (err, page) {