Generating sitemap for angular app using it's routes

Viewed 932

I'm trying to generate sitemap for each module using express server.

Below is my project structure.

-Root
--ModuleA
--ModuleB
--ModuleC

I've generated root level sitemap.xml and it has reference to ModuleA sitemap.xml. Like below

<sitemap>
    <loc>https://wwws.example.com/moduleA/sitemap.xml</loc>
</sitemap>
<sitemap>
    <loc>https://wwws.example.com/moduleB/sitemap.xml</loc>
</sitemap>

Now the problem is, I need to generate sitemap.xml based on it's routes for each individual modules(A,B,C).

I can use app.get(moduleA/sitemap.xml) but how will pass the routes ?

Please help me with the design so that I build it peacefully.

0 Answers
Related