1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { messages } from "https://esm.town/v/jdan/messages";
export function messageBoard(req, res) {
// make sure u change this or else i'll get your messages
const action = "https://jdan-writeMessage.express.val.run";
res.send(`
<table border="2" cellpadding="4">
<thead>
<tr>
<th>Name</th>
<th>Message</th>
</tr>
</thead>
<tbody>
${
messages.filter((m) => m.approved).reverse().map((m) => {
return `
<tr>
<td>
${m.name}
</td>
<td>
${m.message}
</td>
</tr>
`;
}).join("")
}
</tbody>
</table><br><br><br>
<form action="${action}" method="POST">
<label>
Name: <br/>
<input name="name" />
</label>
<br />
<label>
Message:<br/>
<textarea name="message"></textarea>
</label><br /><br />
<input type="submit" />
</form>
<br><br>
Powered by <a href="https://val.town">val.town</a>. Check me out: <a href="https://www.val.town/v/jdan.messageBoard">https://www.val.town/v/jdan.messageBoard</a>
`);
}