Loading...
Loading...
Use when building or editing a Marko Run (@marko/run) app — anything under src/routes (+page, +layout, +handler, +middleware, +meta, +404, +500), route path syntax ($id, $$rest, _pathless, flat routes), Run.GET/POST verb helpers, ctx/$global request context, validation (params/search/json/form), data loading via next(), Run.href, vite.config adapters (node/static/netlify), or the marko-run CLI. Not for Marko template syntax itself (see marko6).
npx skill4agent add svallory/marko-ui marko-runreferences/routing.mdreferences/handlers.mdreferences/deploy.mdsrc/routes/**+ctx$globalctx.paramsctx.urlctx.serializedGlobalsnext({ ... })ctx.data$global.data<await>nextRunRun.GET/HEAD/POST/PUT/DELETE/PATCH/OPTIONS/QUERY/ALLRun.hrefRun.ContextRun.Platform| File | Role |
|---|---|
| GET → HTML. One per path. |
| wraps nested layouts/pages; |
| |
| |
| static |
| root-only; when |
users_admin$id$$$rest$$projects.$projectId.members+page.markoprojects.$projectId/members+page.markomembers,people+page.marko(members,people)(home,)(home,_x)`sitemap.xml`/+handler.tsexport const POST = Run.POST({ json: NoteSchema }, async (ctx, next) => {
const [note, issues] = await ctx.body; // Standard Schema → [value, issues]; fn validator → its return
if (issues) return Response.json({ issues }, { status: 422 });
return ctx.redirect("/thanks"); // PRG on success; next({ issues }) to re-render form with errors
});paramssearchjsonvalidatormaxBytesformvalidatormaxBytesmaxPartsmaxFilesmaxFileBytesonFile(ctx, file)Run.POST(options, [auth, handler])ctx.bodyawait ctx.bodyundefinedjsonformctx.request.json()ctxfetch(url, init)parentrender(template, input, init)redirect(to, status=302)back(fallback="/", status)Run.href("/projects/$projectId/members", { params: { projectId: 42 }, search: {...}, hash }).marko-run/routes.d.tsinclude.marko-run/routes.d.tsincludeRun.Contextdatadeclare module "@marko/run" { interface Context { db: DB } interface Platform { ... } }next()vite.configimport marko from "@marko/run/vite"; plugins: [marko({ adapter, routesDir, trailingSlashes })]@marko/vitetrailingSlashesRedirectWithoutRedirectWithRewriteWithoutRewriteWithIgnore@marko/run-adapter**marko-run-adapter*@marko/run-adapter-noderouterMiddleware()matchMiddleware()req.route.invoke@marko/run-adapter-staticurls: [...] | async fn@marko/run-adapter-netlify{ edge: true }netlify.tomlfunctionsedge_functions = "dist"dist/publicimport * as router from "@marko/run/router"router.fetch(request, platform)router.match(method, path)router.invoke(route, request, platform)marko-runbun runbunxdev-pbuild-opreview-o -p -f-c config-e dotenvGETnext()next()POSTctx.body()Response$$catch-all$global.sessionparamsurlctx.serializedGlobals