-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sitemap proxied from nextjs app (#183)
* fix: sitemap proxied from nextjs app * fix: robots.txt to new sitemap * fix: cpu limit * fix: better init strapi (#192) --------- Co-authored-by: YoanRos <[email protected]> Co-authored-by: Matéo Mévollon <[email protected]> Co-authored-by: Matéo Mévollon <[email protected]>
- Loading branch information
1 parent
be85e5f
commit ec9c454
Showing
4 changed files
with
55 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// sitemap/index.xml | ||
// https://api-ozensemble-site.fabrique.social.gouv.fr/api/sitemap/index.xml | ||
export const dynamic = "force-dynamic" // defaults to auto | ||
|
||
export async function GET() { | ||
const sitemap = await fetch( | ||
"https://api-ozensemble-site.fabrique.social.gouv.fr/api/sitemap/index.xml" | ||
).then((res) => res.text()) | ||
|
||
if (!sitemap) { | ||
return new Response("It exists but its fucked up", { | ||
headers: { | ||
"Content-Type": "text/xml", | ||
}, | ||
}) | ||
} | ||
return new Response( | ||
sitemap.replace( | ||
`<?xml-stylesheet type="text/xsl" href="xsl/sitemap.xsl"?>`, | ||
`` | ||
), | ||
{ | ||
headers: { | ||
"Content-Type": "text/xml", | ||
}, | ||
} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters