421 if (url.pathname === "/create-checkout-session" && req.method === "POST") {
422 const stripe = new Stripe(Deno.env.get("STRIPE_VALTOWN_SECRET_KEY"), {
423 apiVersion: "2022-11-15",
424 });
425
460
461 const stripe = new Stripe(Deno.env.get("STRIPE_VALTOWN_SECRET_KEY"), {
462 apiVersion: "2022-11-15",
463 });
464
1Simple helper for sending a message over XMPP. For an API that doesn't require your own bot setup see https://www.val.town/v/singpolyma/sendxmpp
2
3```js
13 setError("");
14 try {
15 const res = await fetch(`${window.location.href}api/map`, {
16 method: "POST",
17 headers: {
103 const url = new URL(req.url);
104
105 if (req.method === "POST" && url.pathname === "/api/map") {
106 const { domain } = await req.json();
107 if (!domain) {
110
111 try {
112 const response = await fetch("https://api.firecrawl.dev/v1/map", {
113 method: "POST",
114 headers: {
2
3const browser = await puppeteer.connect({
4 browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
5})
6
13 setError("");
14 try {
15 const res = await fetch(`${window.location.origin}/api`, {
16 method: 'POST',
17 headers: {
123 const url = new URL(req.url);
124
125 if (req.method === "POST" && url.pathname === "/api") {
126 try {
127 const { domain } = await req.json();
130 }
131
132 const firecrawlResponse = await fetch("https://api.firecrawl.dev/v1/map", {
133 method: "POST",
134 headers: {
26 setError("");
27 try {
28 const res = await fetch(`${window.location.href}api?city=${encodeURIComponent(city)}`);
29 const data = await res.json();
30 if (data.error) {
159 const url = new URL(req.url);
160
161 if (req.method === "GET" && url.pathname === "/api") {
162 const city = url.searchParams.get("city");
163 if (!city) {
167 try {
168 const weatherUrl =
169 `https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t_weather=true&daily=temperature_2m_max,weathercode&timezone=auto&forecast_days=5`;
170 const weatherRes = await fetch(weatherUrl);
171 const weatherData = await weatherRes.json();
16 const { provider, id } = c.req.param();
17 if (!["rabbit", "mega"].includes(provider)) {
18 return c.json({ error: "Invalid API request" }, 500);
19 }
20 // const cache = await blob.getJSON(id);
1Migrated from folder: GraphQL/graphqlAPIEndpoint
15 try {
16 const fal = createFalClient({
17 proxyUrl: "/api/fal/proxy",
18 });
19
139 }
140
141 if (url.pathname === "/api/fal/proxy") {
142 return falProxyRequest(req);
143 }
71 `;
72
73 console.log(`Making LSD API request for ${pageUrl}...`);
74 const response = await fetch(
75 `https://lsd.so/api?query=${encodeURIComponent(query)}`
76 );
77