1import { Resend } from "resend";
2
3const resend = new Resend(Deno.env.get("RESEND_API_KEY"));
4
5// resend.emails.send({
1Deno.env.get(VAL_TOWN_API_KEY);
2
3console.log(VAL_TOWN_API_KEY);
16 return c.text("Invalid form submission, missing 'code'", 400);
17 }
18 let apiKey = form.get("key") as string;
19 // TODO: remove this once we have import maps working
20 code = code.replaceAll(`from "@valtown/sdk"`, `from "npm:@valtown/sdk"`);
22 const body = new ReadableStream({
23 async start(controller) {
24 worker = newWorker({ code, env: { ...(apiKey ? { VAL_TOWN_API_KEY: apiKey } : {}) } });
25 await new Promise<void>((resolve, reject) => {
26 (worker as Worker).onmessage = (e) => {
1import { Resend } from "resend";
2
3const resend = new Resend(Deno.env.get("RESEND_API_KEY"));
4
5// resend.emails.send({
10// mock data
11const IMAGE_URLS = [
12 "https://charmaine-blob_admin.web.val.run/api/public/public%2F1738957396306_pngtree-valentine-day-gift-box-open-love-heart-and-rose-potale-greeting-png-image_6564851.png",
13 "https://charmaine-blob_admin.web.val.run/api/public/public%2F1738959510139_2020-heart-pounding-animation.gif",
14 "https://charmaine-blob_admin.web.val.run/api/public/public%2F1738959545863_sugary-heart-valentine-png-5692911.png",
15 "https://charmaine-blob_admin.web.val.run/api/public/public%2F1738957543311_Red_Happy_Valentine's_Day_PNG_Clip-Art_Image.png",
16];
17
49 />
50 <div>
51 <input type="text" id="key" name="key" placeholder="API KEY" />
52 </div>
53 <button id="submit" type="submit">Submit</button>
26 for (const row of result.rows) {
27 const blobPath = await blob.get(row["path"] as string);
28 images.push(`https://shouser-blob_admin.web.val.run/api/public/${blobPath.url}`);
29 }
30
3hi sophieee
4
5ok so i only edited `frontend_card`, you can see where im directly grabbing a public url i have in my blob storage aka: https://charmaine-blob_admin.web.val.run/api/public/public%2F1738957543311_Red_Happy_Valentine's_Day_PNG_Clip-Art_Image.png
6
7i would love to be able to make get requests to a url like that instead of hard coding them :p
42 <title>Log Me In</title>
43 <meta name="viewport" content="width=device-width, initial-scale=1" />
44 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet" />
45 <style>{css}</style>
46 </head>
25
26 async login(email: string, config: Config | undefined): Promise<string> {
27 const resp = await fetch("https://api.val.town/v1/me", {
28 headers: {
29 "Authorization": `Bearer ${Deno.env.get("valtown")}`,