CinemaPress/routes/robots.js
2019-12-14 00:19:45 +02:00

35 lines
592 B
JavaScript

'use strict';
/**
* Configuration dependencies.
*/
var config = require('../config/production/config');
/**
* Node dependencies.
*/
var express = require('express');
var router = express.Router();
/**
* Robots.
*/
router.get('/?', function(req, res) {
res.header('Content-Type', 'text/plain');
res.send(
config.codes.robots +
'\n\n' +
'Sitemap: ' +
(req.userinfo && req.userinfo.origin
? req.userinfo.origin
: config.protocol + config.subdomain + config.domain) +
'/' +
config.urls.sitemap
);
});
module.exports = router;