Built-in data management, environment variables, and configuration options.
Access environment variables in templates using #env.VAR_NAME# syntax. Perfect for API keys, configuration, and secrets.
USER: #env.USER#
HOME: #env.HOME#
SHELL: #env.SHELL#
API_KEY=secret DEBUG=true cargo run -- dev
<p>API Key: #env.API_KEY#</p>
<p>Debug: #env.DEBUG#</p>
<p>Database: #env.DATABASE_URL#</p>
What includes a built-in JSON data store. Define collections in wwwhat.toml or use the data/ directory.
# wwwhat.toml configuration
[data]
posts = { file = "data/posts.json", cache = 60 }
users = { file = "data/users.json", cache = 300 }
# Using in templates
<loop data="#posts#" as="post">
<h2>#post.title#</h2>
<p>#post.excerpt#</p>
</loop>
Built-in endpoints for create, update, and delete operations on your data collections.
POST /w-action/posts?w-action=create&w-redirect=/posts
POST /w-action/posts/123?w-action=update&w-redirect=/posts
POST /w-action/posts/123?w-action=delete&w-redirect=/posts
<!-- Create form -->
<form action="/w-action/posts?w-action=create&w-redirect=/posts">
<input name="title">
<button type="submit">Create</button>
</form>
<!-- Update form -->
<form action="/w-action/posts/#id#?w-action=update">
<input name="title" value="#post.title#">
<button type="submit">Update</button>
</form>
<!-- Delete button -->
<form action="/w-action/posts/#id#?w-action=delete">
<button type="submit">Delete</button>
</form>
What includes multi-level caching for optimal performance with automatic invalidation.
Cache is automatically invalidated when data is modified via w-action endpoints.
# wwwhat.toml
[cache]
enabled = true
ttl = 300 # 5 minutes default
# Per-collection cache TTL
[data]
posts = { file = "data/posts.json", cache = 60 }
users = { file = "data/users.json", cache = 300 }
Your file structure defines your URLs. No route configuration needed.
# Dynamic routes with [param]
pages/
post/[id].html → /post/123
user/[username].html → /user/john
# Access params in templates
<h1>Post #id#</h1>
<h1>User: #username#</h1>