summaryrefslogtreecommitdiff
path: root/lib/response.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/response.js')
-rw-r--r--lib/response.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/response.js b/lib/response.js
index 20612b68..8b027c12 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -14,7 +14,6 @@ const errors = require('./errors')
// public
var response = {
- showNote: showNote,
showPublishNote: showPublishNote,
showIndex: showIndex,
publishNoteActions: publishNoteActions,
@@ -52,33 +51,6 @@ function showIndex (req, res, next) {
}
}
-function responseCodiMD (res, note) {
- var body = note.content
- var extracted = models.Note.extractMeta(body)
- var meta = models.Note.parseMeta(extracted.meta)
- var title = models.Note.decodeTitle(note.title)
- title = models.Note.generateWebTitle(meta.title || title)
- var opengraph = models.Note.parseOpengraph(meta, title)
- res.set({
- 'Cache-Control': 'private', // only cache by client
- 'X-Robots-Tag': 'noindex, nofollow' // prevent crawling
- })
- res.render('codimd.ejs', {
- title: title,
- opengraph: opengraph
- })
-}
-
-function showNote (req, res, next) {
- noteUtil.findNote(req, res, function (note) {
- // force to use note id
- var noteId = req.params.noteId
- var id = models.Note.encodeNoteId(note.id)
- if ((note.alias && noteId !== note.alias) || (!note.alias && noteId !== id)) { return res.redirect(config.serverURL + '/' + (note.alias || id)) }
- return responseCodiMD(res, note)
- })
-}
-
function showPublishNote (req, res, next) {
var include = [{
model: models.User,