aboutsummaryrefslogtreecommitdiff
path: root/routes/opensearch.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/opensearch.js')
-rw-r--r--routes/opensearch.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/routes/opensearch.js b/routes/opensearch.js
new file mode 100644
index 0000000..c3e2e57
--- /dev/null
+++ b/routes/opensearch.js
@@ -0,0 +1,12 @@
+'use strict'
+
+const express = require('express')
+const router = express.Router()
+const path = require('path')
+
+router.get('/', function (req, res, next) {
+ res.setHeader('content-type', 'application/opensearchdescription+xml')
+ res.sendFile('opensearch.xml', { root: path.join(__dirname, '../public') })
+})
+
+module.exports = router