|
|
@@ -131,6 +131,23 @@ app.get ("/api/msg/:id", function (req, res) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
app.post("/api/createMsg", function(req, res){ |
|
|
|
var message = new Message(req.body); |
|
|
|
|
|
|
|
message.save(function(err,result){ |
|
|
|
if(err) |
|
|
|
return res .status(401) .send(err.message); |
|
|
|
|
|
|
|
res.json({message: "Message created!!"}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// Other stuff is NOT authorized unless logged in |
|
|
|
//app.use (authorize.genCheckAuthorized ('user')); |
|
|
|
|
|
|
|
// Uploaded files |
|
|
|
//app.use ('/uploads', expr ess.static(__dirname + '/uploads')); |
|
|
|
|
|
|
|
// Other stuff is NOT authorized unless logged in |
|
|
|
//app.use (authorize.genCheckAuthorized ('user')); |
|
|
|
|