Skip to content

Node.js based forum software built for the modern web

added dynamically generated robots.txt

Julian Lam782858c72869
diff --git a/src/webserver.js b/src/webserver.js
index 513d1f7453..ae641d95f4 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -237,6 +237,14 @@ var express = require('express'),
});
});
+ app.get('/robots.txt', function(req, res) {
+ res.set('Content-Type', 'text/plain');
+ res.send( "User-agent: *\n" +
+ "Disallow: \n" +
+ "Disallow: /admin/\n" +
+ "Sitemap: " + global.nconf.get('url') + "sitemap.xml");
+ });
+
app.get('/api/:method', api_method);
app.get('/api/:method/:id', api_method);
// ok fine MUST ADD RECURSION style. I'll look for a better fix in future but unblocking baris for this: