mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-12-01 09:24:46 +00:00
app.logicsrc.com: sitemap.xml + robots Sitemap line (public pages only) (#294)
The credentials app answered 404 for both. robots.txt and sitemap.xml now come from the request host, list only the sign-in and sign-up pages, and disallow the session-only areas. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b20afe6f50
commit
d5002540a5
3 changed files with 63 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ import { profileRouter } from "./lib/profile.mjs";
|
|||
import { descriptor } from "@profullstack/footer";
|
||||
import { RING_FOOTER_OPTIONS } from "./lib/ring-footer.mjs";
|
||||
import { securityHeaders } from "./lib/security-headers.mjs";
|
||||
import { robotsTxt, siteOrigin, sitemapXml } from "./lib/seo.mjs";
|
||||
import { PROFILE_ENHANCE_SCRIPT } from "@profullstack/profile";
|
||||
|
||||
const app = express();
|
||||
|
|
@ -73,7 +74,11 @@ app.get("/vendor/profile-enhance.js", (_req, res) => res.type("application/javas
|
|||
app.get("/.well-known/openwebring.json", (_req, res) =>
|
||||
res.json(descriptor({ site: RING_FOOTER_OPTIONS.site, name: "LogicSRC credentials" })));
|
||||
|
||||
app.get("/healthz", (_req, res) => res.json({ ok: true, env: config.env }));
|
||||
// Crawlers: only the public sign-in and sign-up pages, on whichever host was asked.
|
||||
app.get("/robots.txt", (req, res) => res.type("text/plain").set("Cache-Control", "public, max-age=3600").send(robotsTxt(siteOrigin(req, config.origin))));
|
||||
app.get("/sitemap.xml", (req, res) => res.type("application/xml").set("Cache-Control", "public, max-age=3600").send(sitemapXml(siteOrigin(req, config.origin))));
|
||||
|
||||
app.get("/healthz",(_req, res) => res.json({ ok: true, env: config.env }));
|
||||
|
||||
// The keyring share link (/k/<token>.json|.keys): public, CORS-open, no session
|
||||
// (mounted before the session middleware so it never sets a cookie on a cacheable answer).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue