Skip to content

Commit

Permalink
all set
Browse files Browse the repository at this point in the history
  • Loading branch information
SH20RAJ authored Mar 25, 2024
1 parent 273ca98 commit c4ff91c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/sitemapsh/[id]/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ let getArticlesFromDevTo = async (params) => {
return data;
};

export async function GET(req) {
export async function GET(req, res) {
console.log(res);
if (req.method === "GET") {
try {
// Fetch articles from Dev.to or your database
let articles = await getArticlesFromDevTo(0);
let articles = await getArticlesFromDevTo(res.params.id);

// Start building the XML
let xml = '<?xml version="1.0" encoding="UTF-8"?>';
Expand All @@ -44,7 +45,7 @@ export async function GET(req) {
xml += "<priority>1</priority>"; // Priority can be adjusted based on the importance of the page
xml += "</url>";
});

xml += "</urlset>";

// Set the response headers and status
Expand Down

0 comments on commit c4ff91c

Please sign in to comment.