How info.tomas.im works
A zero-configuration hosting system. Drop a folder, deploy, get a subdomain. Here's what happens under the hood.
The Idea
One repo, many projects, automatic subdomains.
Every folder inside projects/ becomes its own site at <name>.info.tomas.im. No configuration needed — the system discovers projects at build time and routes traffic at the edge.
Static
Plain HTML/CSS/JS. Copied as-is to the CDN.
defaultBuildable
Has package.json. Auto-built, output deployed.
Redirect
Has redirect.json. 301 redirect at the edge.
Request Flow
What happens when you visit a project subdomain.
The Edge Function
The routing logic, running at 400+ locations worldwide.
CloudFront Functions use cloudfront-js-1.0 — a stripped-down ES5 runtime. No const, no arrow functions, no async. Just var. That's what makes them sub-millisecond.
// Extract subdomain from Host header var host = event.request.headers.host.value; var parts = host.split("."); // Root domain → landing page if (host === "info.tomas.im") { return event.request; } var subdomain = parts[0]; // Check redirect map (inlined at deploy) if (redirects[subdomain]) { return { statusCode: 301, headers: { location: { value: redirects[subdomain] } }}; } // Rewrite → /projects/<subdomain>/... event.request.uri = "/projects/" + subdomain + uri; return event.request;
Build Pipeline
What bun run build does before deployment.
Scan
Read projects/ directory. Classify each folder as static, buildable, or redirect.
Validate
Check names: lowercase, alphanumeric, hyphens only. Catch duplicates. Fail fast.
Build
Static → copy. Buildable → install && build, copy output. Redirect → map entry.
Generate
Landing page HTML, thumbnails, redirect map JSON. Everything lands in .build/.
Tech Stack
Everything that powers this system.
/projects/<name>/ structure
Add a Project
It takes about 30 seconds.
✓ Uploaded to S3
✓ CloudFront invalidated