Skip to content

Commit 23b9f57

Browse files
committed
try proxying sitemap
1 parent 33ea176 commit 23b9f57

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/index.server.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ app.use(
1616
}),
1717
);
1818

19-
const proxyMiddleware = proxy('localhost', { port: 5000 });
19+
const proxyMiddleware = proxy(
20+
process.env.REACT_APP_API_HOST ?? 'http://localhost:5000',
21+
{},
22+
);
2023

21-
app.use(router.routes()).use(router.allowedMethods());
24+
app.use((ctx, next) => {
25+
return next();
26+
});
2227

28+
app.use(router.routes()).use(router.allowedMethods());
2329
app.use(ssrMiddleware);
2430
app.use(proxyMiddleware);
2531
// router.get('/ads.txt', (ctx) => {

src/server/serverRender.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function extractFromCookie(cookie: string | undefined, key: string) {
4040

4141
const serverRender = async ({ url, loggedIn, cookie }: SSROption) => {
4242
// enable proxy to backend server in development mode
43-
if (/^\/(api|graphql)/.test(url)) {
43+
if (/^\/(api|graphql|sitemaps)/.test(url)) {
4444
return null;
4545
}
4646

0 commit comments

Comments
 (0)