nerak repo

This commit is contained in:
2026-07-07 15:34:30 -05:00
committed by nightshade
commit 3822b310df
84 changed files with 5387 additions and 0 deletions
@@ -0,0 +1,4 @@
CREATE TABLE greetings (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);
@@ -0,0 +1,3 @@
select name
from greetings
limit 1;
@@ -0,0 +1,7 @@
<html>
<body>
{{#hello_world_data}}
<p>Hello {{name}}</p>
{{/hello_world_data}}
</body>
</html>
+19
View File
@@ -0,0 +1,19 @@
#include <nerak.h>
#include <sqlite.h>
config(main){
sqlite_database(
.name = "hello_db",
.connect = "file:hello.db?mode=rwc",
.migrations = {"create_hello_world_table"},
.seeds = {"seed_hello_world"}
);
resource("home", "/",
.get = {
sqlite_query({"hello_db", "get_hello_world", "hello_world_data"}),
mustache("hello_world", "hello"),
respond("hello")
}
);
}
@@ -0,0 +1,2 @@
INSERT INTO greetings(name)
VALUES('World');