feat: Add route to generate sitemap in XML format
All checks were successful
Update Memento Dev on VPS / deploy (push) Successful in 3m10s
All checks were successful
Update Memento Dev on VPS / deploy (push) Successful in 3m10s
This commit is contained in:
parent
0d1e4910fb
commit
82969d08cb
@ -73,6 +73,11 @@ async function startServer() {
|
|||||||
|
|
||||||
app.post<{ Body: string }>("/_telefunc", createHandler(telefuncHandler)());
|
app.post<{ Body: string }>("/_telefunc", createHandler(telefuncHandler)());
|
||||||
|
|
||||||
|
app.get("/sitemap.xml", async (_request, reply) => {
|
||||||
|
reply.type("application/xml");
|
||||||
|
reply.send(sitemap.getSitemap());
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vike route
|
* Vike route
|
||||||
*
|
*
|
||||||
|
|||||||
@ -151,6 +151,11 @@ class Sitemap {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getSitemap(): string {
|
||||||
|
if (!this.sitemap) this.generateSitemap();
|
||||||
|
return this.sitemap;
|
||||||
|
}
|
||||||
|
|
||||||
public generateSitemap(): void {
|
public generateSitemap(): void {
|
||||||
console.log("Generating sitemap...");
|
console.log("Generating sitemap...");
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user