Make a big amalgamation of HTTP, WL, sqlite alongside cweb

This commit is contained in:
2025-09-24 10:51:12 +02:00
parent 0790a11b00
commit f2d5eef6d2
23 changed files with 275535 additions and 361 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
include "pages/page.wl"
include "page.wl"
let posts = $query("SELECT P.id, P.title, P.is_link, P.content, (SELECT COUNT(*) FROM Comments as C WHERE c.parent_post=P.id) as num_comments, CURRENT_TIMESTAMP as date FROM Posts as P")
+3 -3
View File
@@ -1,5 +1,5 @@
include "pages/page.wl"
include "pages/login_and_signup_style.wl"
include "page.wl"
include "login_and_signup_style.wl"
let main =
<main>
@@ -7,7 +7,7 @@ let main =
<div id="response"></div>
<form hx-post="/api/login" hx-target="#response">
<form action="/api/login" method="POST">
<input type="text" name="username" placeholder="username" />
<input type="password" name="password" placeholder="password" />
<input type="submit" value="Log-In" />
+1 -1
View File
@@ -1,4 +1,4 @@
include "pages/page.wl"
include "page.wl"
let style =
<style>
+1 -1
View File
@@ -1,4 +1,4 @@
include "pages/page.wl"
include "page.wl"
let posts = $query("SELECT U.username, P.title, P.content FROM Posts as P, Users as U WHERE P.id=? AND U.id=P.author", $post_id)
let comments = $query("SELECT C.id, U.username, C.content, C.parent_post, C.parent_comment FROM Comments as C, Users as U WHERE C.parent_post=? AND U.id=C.author", $post_id)
+1 -1
View File
@@ -1,4 +1,4 @@
include "pages/page.wl"
include "page.wl"
let posts = $query("SELECT title, content FROM Posts WHERE id=?", $post_id)
let comments = $query("SELECT C.id, U.username, C.content, C.parent_post, C.parent_comment FROM Comments as C, Users as U WHERE C.parent_post=? AND U.id == C.author", $post_id)
+3 -3
View File
@@ -1,5 +1,5 @@
include "pages/page.wl"
include "pages/login_and_signup_style.wl"
include "page.wl"
include "login_and_signup_style.wl"
let main =
<main>
@@ -7,7 +7,7 @@ let main =
<div id="response"></div>
<form hx-post="/api/signup" hx-target="#response">
<form action="/api/signup" method="POST">
<input type="text" name="username" placeholder="username" />
<input type="email" name="email" placeholder="email" />
<input type="password" name="password1" placeholder="password" />
+1 -1
View File
@@ -1,4 +1,4 @@
include "pages/page.wl"
include "page.wl"
let style =
<style>