annotate src/get_chats.js.luan @ 57:c420f39eb474

chatuser_key
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 04 Mar 2025 07:05:12 -0700
parents 8b8905f63d80
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local Parsers = require "luan:Parsers.luan"
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 local json_string = Parsers.json_string or error()
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 local Io = require "luan:Io.luan"
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 local Http = require "luan:http/Http.luan"
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 local Shared = require "site:/lib/Shared.luan"
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 local chats_html = Shared.chats_html or error()
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 return function()
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 Io.stdout = Http.response.text_writer()
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 %>
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 gotChats(<%=json_string(`chats_html()`)%>);
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 <%
8b8905f63d80 add get_chats
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 end