246 e.preventDefault();
247 const finalAmount = showCustomAmount ? parseFloat(customAmount) : amount;
248 const response = await fetch("/create-checkout-session", {
249 method: "POST",
250 headers: { "Content-Type": "application/json" },
504 }
505
506 // Fetch all tips for the root endpoint
507 const allTips = await sqlite.execute(
508 `SELECT name, amount, comment, timestamp FROM ${KEY}_payments_${SCHEMA_VERSION} ORDER BY amount DESC`,
4 const headers = new Headers(req.headers);
5 headers.set("x-proxy-authorization", `Bearer ${Deno.env.get("valtown")}`);
6 return fetch("https://fal-faltownproxy.web.val.run/api/faltown/proxy", {
7 method,
8 headers,
23
24 try {
25 const response = await fetch("/", {
26 method: "POST",
27 body: JSON.stringify({ prompt, currentCode: code }),
32 const url = new URL("." + pathname, "http://localhost:" + port);
33 url.search = search;
34 const resp = await fetch(url, {
35 method: req.method,
36 headers: req.headers,
172});
173
174export default app.fetch.bind(app);
175
176const css = `
64
65 try {
66 const response = await fetch('${httpEndpoint}', {
67 method: 'POST',
68 body: code,
42 e.preventDefault();
43 const finalAmount = showCustomAmount ? parseFloat(customAmount) : amount;
44 const response = await fetch("/create-checkout-session", {
45 method: "POST",
46 headers: { "Content-Type": "application/json" },
205
206 useEffect(() => {
207 fetchPayments();
208 const urlParams = new URLSearchParams(window.location.search);
209 if (urlParams.get('success') === 'true') {
212 }, []);
213
214 const fetchPayments = async () => {
215 const response = await fetch('/get-payments');
216 const data = await response.json();
217 setPayments(data);
223 <div className="w-full max-w-[90%] flex flex-col md:flex-row gap-8">
224 <div className="w-full md:w-1/2 order-2 md:order-1">
225 <TippingForm onPaymentSuccess={fetchPayments} />
226 </div>
227 <div className="w-full md:w-1/2 order-1 md:order-2">
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { sqliteStyle } from "https://esm.town/v/robaggio/sqliteStyle";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));
42 const fullUrl = `${HOSTED_PHOENIX_BASE_URL}${Url.pathname}${Url.search}`;
43
44 return fetch(fullUrl, init);
45}
44
45 try {
46 const response = await fetch("/", {
47 method: "POST",
48 body: JSON.stringify({ prompt, currentCode: code }),