Allow robots.txt to be custom
This commit is contained in:
parent
0cbacf5b4b
commit
5629063b9c
1 changed files with 10 additions and 2 deletions
|
@ -12,8 +12,16 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
//serve robots.txt
|
//serve robots.txt
|
||||||
args.app.get('/robots.txt', function(req, res)
|
args.app.get('/robots.txt', function(req, res)
|
||||||
{
|
{
|
||||||
var filePath = path.normalize(__dirname + "/../../../static/robots.txt");
|
var filePath = path.normalize(__dirname + "/../../../static/custom/robots.txt");
|
||||||
|
res.sendfile(filePath, function(err)
|
||||||
|
{
|
||||||
|
//there is no custom favicon, send the default robots.txt which dissallows all
|
||||||
|
if(err)
|
||||||
|
{
|
||||||
|
filePath = path.normalize(__dirname + "/../../../static/robots.txt");
|
||||||
res.sendfile(filePath);
|
res.sendfile(filePath);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//serve favicon.ico
|
//serve favicon.ico
|
||||||
|
|
Loading…
Reference in a new issue