summaryrefslogtreecommitdiff
path: root/lib/web
diff options
context:
space:
mode:
Diffstat (limited to 'lib/web')
-rw-r--r--lib/web/middleware/codiMDVersion.js10
-rw-r--r--lib/web/statusRouter.js6
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/web/middleware/codiMDVersion.js b/lib/web/middleware/codiMDVersion.js
new file mode 100644
index 00000000..e7775876
--- /dev/null
+++ b/lib/web/middleware/codiMDVersion.js
@@ -0,0 +1,10 @@
+'use strict'
+
+const config = require('../../config')
+
+module.exports = function (req, res, next) {
+ res.set({
+ 'CodiMD-Version': config.version
+ })
+ return next()
+}
diff --git a/lib/web/statusRouter.js b/lib/web/statusRouter.js
index 4495a28e..256fead0 100644
--- a/lib/web/statusRouter.js
+++ b/lib/web/statusRouter.js
@@ -17,8 +17,7 @@ statusRouter.get('/status', function (req, res, next) {
realtime.getStatus(function (data) {
res.set({
'Cache-Control': 'private', // only cache by client
- 'X-Robots-Tag': 'noindex, nofollow', // prevent crawling
- 'HackMD-Version': config.version
+ 'X-Robots-Tag': 'noindex, nofollow' // prevent crawling
})
res.send(data)
})
@@ -102,8 +101,7 @@ statusRouter.get('/config', function (req, res) {
}
res.set({
'Cache-Control': 'private', // only cache by client
- 'X-Robots-Tag': 'noindex, nofollow', // prevent crawling
- 'HackMD-Version': config.version
+ 'X-Robots-Tag': 'noindex, nofollow' // prevent crawling
})
res.render(config.constantsPath, data)
})