29 const handleNo = async () => {
30 setNoClicks(prev => prev + 1);
31 await fetch("/api/response", {
32 method: "POST",
33 headers: { "Content-Type": "application/json" },
38 const handleYes = async () => {
39 setIsValentine(true);
40 await fetch("/api/response", {
41 method: "POST",
42 headers: { "Content-Type": "application/json" },
33
34 console.log("User selected:", answer);
35 // fetch("/response", {
36 // method: "POST",
37 // headers: { "Content-Type": "application/json" },
10
11 // Send response to the server (optional)
12 fetch("/response", {
13 method: "POST",
14 headers: { "Content-Type": "application/json" },
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
185);
186
187export default app.fetch;
188
189/***************************************************************
363 },
364 {
365 "key": "http.request.header.sec-fetch-mode",
366 "value": {
367 "stringValue": "cors",
813 },
814 {
815 "key": "http.request.header.sec-fetch-mode",
816 "value": {
817 "stringValue": "cors"
6
7export async function sendWithRateLimit(url: string, init: RequestInit): Promise<Response> {
8 const resp = await fetch(url, init);
9 if (resp.status === 429) {
10 const retryAfter = resp.headers.get("Retry-After");
38
39 try {
40 const response = await fetch("/chat", {
41 method: "POST",
42 headers: { "Content-Type": "application/json" },
38
39 try {
40 const response = await fetch("/chat", {
41 method: "POST",
42 headers: { "Content-Type": "application/json" },
38
39 try {
40 const response = await fetch("/chat", {
41 method: "POST",
42 headers: { "Content-Type": "application/json" },