1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-12 02:42:48 +00:00

updated bunch of file paths and changed the way posts are loaded

This commit is contained in:
2016-01-05 12:28:04 -06:00
parent 4bb8cae81e
commit 6ab45fe935
13249 changed files with 317868 additions and 2101398 deletions

View File

@@ -9,12 +9,23 @@ var routes = function(config) {
var ctx = {
title: 'Viewing Document: ' + req.document._id,
editorTheme: config.options.editorTheme,
docString: bson.toString(req.document)
docString: bson.toString(req.document),
};
res.render('document', ctx);
};
exp.checkValid = function(req, res) {
var doc = req.body.document;
try {
bson.toBSON(doc);
} catch (err) {
console.error(err);
return res.send('Invalid');
}
res.send('Valid');
};
exp.addDocument = function(req, res) {
var doc = req.body.document;
@@ -46,7 +57,6 @@ var routes = function(config) {
});
};
exp.updateDocument = function(req, res) {
var doc = req.body.document;
@@ -79,7 +89,6 @@ var routes = function(config) {
});
};
exp.deleteDocument = function(req, res) {
req.collection.remove(req.document, {safe: true}, function(err) {
if (err) {