35 lines
592 B
JavaScript
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;
|