A page
One file is an application. Nothing is configured and nothing is generated by hand.
Goal
Get a page serving from a folder, and see that the route table, the plan and the tier were all derived from where the file sits rather than from anything you wrote down.
Start with a folder. There is no template to instantiate, no config to write, and nothing to register — a route is a file, and this one is the only file you need.
1 · Make the folder
mkdir shop && cd shop
npm init -y && npm i weft
mkdir -p app/routes2 · Write the one file
// app/routes/index.tsx
import { fragment } from '@weftjs/core'
export default fragment(() => (
<section>
<h2>Today</h2>
<p>Nothing yet.</p>
</section>
))3 · Serve it
npx weft dev4 · Ask the framework what it knows
There is no app/layout.tsx, so the page is wrapped in the framework’s own document. Ask what the plan is:
npx weft routes
npx weft why /One route, one slot named body, delivery buffered. Nothing streams because nothing asked to, and nothing is keyed because the fragment reads nothing — which means this page is already in the tier where a document is a file. npx weft build writes it as one.