Commit b40cd6f2 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza
Browse files

Proxy sitemap.xml

parent 12b2acfa
......@@ -10,6 +10,7 @@ import {readFileSync} from 'fs';
import config from './config';
import prerenderer from './middleware/prerenderer';
import robots from './robots';
import sitemap from './sitemap';
import i18nServer from '../i18n/i18n-server';
import httpProxy from './middleware/httpProxy';
const i18nextMiddleware = require('i18next-express-middleware'); // has no proper import yet
......@@ -44,6 +45,8 @@ app.get('/en/*', (req, res) => {
const redirectPath = oldPath.substr(3, oldPath.length);
res.redirect(301, `${config.frontendPath}${redirectPath}`);
// Handle sitemap.xml and references files
app.get('/sitemap*.xml', sitemap);
// Enable compression
// robots.txt
import axios from 'axios';
import config from './config';
const sitemap = (req, res) => {
method: 'get',
url: `${config.apiUrl}${req.path}`,
}).then(response => {
return res.set('Content-Type', 'text/xml').send(;
}).catch(error => {
export default sitemap;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment