Best viewed on desktop Mobile Friendly tutorial coming soon!
Your First Routes
Every lesson so far ran inside an app you never had to configure —
that app is marko-run, and this part finally opens it up. The
deal: files in src/routes/ become URLs. No route table, no
config; a +page.marko file establishes a GET route at its
directory’s path:
src/routes/ +page.marko → / about/ +page.marko → /aboutThe + prefix is how marko-run recognizes routable files among your
other modules — everything you learned in parts one through four
(tags, styles, state) works unchanged inside them; a page is just a
component that answers a URL.
The site on the right has a home page whose nav links to /about —
currently a 404:
- Create the folder
src/routes/aboutand inside it the file+page.marko. - Give it a full page: heading “About us”, a paragraph, and an
<a href="/">Home</a>link back. - Click between the two pages. Two files, two URLs, zero configuration — and notice each navigation is a full page load; these are real server-rendered pages.
Files
Preparing Environment
- Installing dependencies
- Starting dev server