FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
chadparker
chadparkercp-root
Public
Like
cp-root
Home
Code
6
.townie
1
README.md
H
index.tsx
H
old-get_vals_endpoints.tsx
H
old-scan-vals.tsx
H
read-vals.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
README.md

cp-root router

status:

  • fetch my vals
  • loop through vals
  • look at each val's file list to find endpoints.tsx
  • refine the filtering
    • only one filter: find endpoints.* where * could be js, jsx, ts, tsx
  • read each matching val's endpoints file
  • refactor into helper functions for better maintainability
  • order functions to make sense
  • format output
  • fetch it from cloudflare
  • save to db or kv store
  • implement cache invalidation
  • manual refresh endpoint

plan:

this will loop through all of my vals, collecting the ones with endpoints.tsx, and updating something somewhere, I'm not sure what yet.

if this pushes to somewhere else make sure to store the secret location in an env var.

but it would be better to pull from elsewhere when needed, with some intelligent caching.

Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.