FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
pomdtr
pomdtrssr_router
Public
Like
ssr_router
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Settings
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
/
Code
/
Search
main.tsx
https://pomdtr--c15305f2277f11f0b46e569c3dd06744.web.val.run
README.md

SSR Framework for val.town

Usage

The router map url paths to component vals.

Component vals must export a React Component as their default export:

Create val
export default function() { <h1>Hello World!</h1> }

Optionally, you can define an handler next to your component, allowing you to handle query params or form inputs.

Use the ctx.render function to pass props to your component.

Create val
export const handler: Handler = (ctx) => { const url = new URL(ctx.req.url); const params = new URLSearchParams(url.search); return ctx.render({ name: params.get("name") }); }; export default function(props: {name?: string}) { <h1>Hello { name || "World }!</h1> }
HTTP
  • main.tsx
    pomdtr--c1…44.web.val.run
Code
README.md
H
main.tsx
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.