summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/index.js2
-rw-r--r--server/lib/api/projects.js23
2 files changed, 15 insertions, 10 deletions
diff --git a/server/index.js b/server/index.js
index a3c1a22..1858825 100644
--- a/server/index.js
+++ b/server/index.js
@@ -50,7 +50,7 @@ site.setup = function(){
app.use(express.session({
key: 'vvalls.sid',
secret: 'flibbertigibbet',
- cookie: { domain: '.' + config.hostName, maxAge: 432000000 },
+ cookie: { domain: '.' + config.hostName, maxAge: 43200000000 },
store: SessionStore
}));
app.use(bodyParser());
diff --git a/server/lib/api/projects.js b/server/lib/api/projects.js
index fc54a5f..bd3cb81 100644
--- a/server/lib/api/projects.js
+++ b/server/lib/api/projects.js
@@ -72,15 +72,20 @@ var projects = {
data.slug = util.slugify(data.name)
data.description = util.sanitize(data.description)
- upload.put("projects", req.files.thumbnail, {
- unacceptable: function(err){
- res.json({ error: { errors: { thumbnail: { message: "Problem saving thumbnail: " + err } } } })
- },
- success: function(url){
- data.photo = url
- done()
- }
- })
+ if (req.files.thumbnail) {
+ upload.put("projects", req.files.thumbnail, {
+ unacceptable: function(err){
+ res.json({ error: { errors: { thumbnail: { message: "Problem saving thumbnail: " + err } } } })
+ },
+ success: function(url){
+ data.photo = url
+ done()
+ }
+ })
+ }
+ else {
+ done()
+ }
function done() {
Project.findOne({ _id: _id }, function(err, doc){