This commit is contained in:
2025-05-08 21:27:29 -05:00
parent c143b8d3a5
commit 7456bf9bc0
49 changed files with 604 additions and 1197 deletions

View File

@@ -0,0 +1,14 @@
func Components.Shell(body)
{
return <!DOCTYPE html>
<html lang={"en"}>
<head>
<meta charset={"UTF-8"}>
<meta name={"viewport"} content={"width=device-width, initial-scale=1.0"}>
<title>Hello, world</title>
</head>
<body>
<raw(body)>
</body>
</html>;
}

View File

@@ -0,0 +1,9 @@
var count = 0;
func Pages.Index()
{
return Components.Shell(
<h1>Hello, world</h1>
<span>Views: {++count}</span>
);
}

View File

@@ -1,5 +1,12 @@
var count = 0;
func main(args)
{
Net.Http.ListenSimpleWithLoop(Router,4206);
Net.Http.ListenSimpleWithLoop((ctx)=>{
if(ctx.Path == "/")
{
ctx.WithMimeType("text/html").SendText(Pages.Index());
return true;
}
return false;
},4206);
}