index-now
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v5View latest version
This val automates IndexNow submission by:
- Crawling sitemap URLs.
- Tracking submission history in SQLite.
- Submitting only changed URLs in batches (up to 10,000 URLs per POST).
indexnow.cron.ts: scheduled automation trigger.indexnow.http.ts: manual trigger for dry runs and debugging.
The recommended setup is a cron trigger every hour for sitemap polling, plus the HTTP trigger when you want immediate/manual control.
Without configuration, the val is preconfigured for:
- Host:
www.hanayou.studio - Sitemap:
https://www.hanayou.studio/sitemap.xml - Key location:
https://www.hanayou.studio/2dc12b205bfe46d19a75077e3991f7ce.txt
The key value is fetched from the key file at runtime, so the code does not hardcode the key.
INDEXNOW_SITES_JSON(optional): JSON array of site configs.INDEXNOW_ENDPOINT(optional): defaults tohttps://api.indexnow.org/indexnow.INDEXNOW_MAX_URLS_PER_RUN(optional): defaults to5000.
[ { "host": "www.hanayou.studio", "sitemapUrl": "https://www.hanayou.studio/sitemap.xml", "keyLocation": "https://www.hanayou.studio/2dc12b205bfe46d19a75077e3991f7ce.txt", "key": "optional-explicit-key", "includePrefixes": ["/journal/", "/guides/"], "excludePrefixes": ["/tag/", "/author/"] } ]
- Dry run:
?dryRun=1 - Force resubmit currently eligible URLs:
?force=1 - Target a single configured site:
?site=www.hanayou.studio
Example:
https://<your-val>.web.val.run/?dryRun=1&site=www.hanayou.studio
SQLite tables:
indexnow_url_state_v1: per-URL state (seen/submitted timestamps, lastmod, status).indexnow_run_log_v1: per-run summaries for observability and debugging.