Files
crosslangextras/Templates/npmweb/src/pages/echo.tcross
Mike Nolan 0459b0a84e
All checks were successful
Build and Deploy on Tag / build-crosslang-shell-and-cpkg (push) Successful in 37s
Add the templates for npm
2026-05-10 20:52:26 -05:00

35 lines
888 B
Plaintext

func Pages.Echo(ctx)
{
const text = ctx.QueryParams.TryGetFirst("text");
var pages = [
{
active = true,
route = "/",
text = "Home",
icon = "home"
},
{
active = false,
route = "/counter",
text = "Counter",
icon = "exposure_plus_1"
},
{
active = false,
route = "/about",
text = "About",
icon = "info"
}
];
ctx.WithMimeType("text/html").SendText(Components.Shell("Echo",pages,<section>
<if(text != null)>
<true>
<plink(text)>
</true>
<false>
<p>No text available</p>
</false>
</if>
</section>));
return true;
}