cerebras_codergenerate-code1 match
16};
17} else {
18const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
19const completion = await client.chat.completions.create({
20messages: [
replicate_starterREADME.md1 match
71. Create a [Val Town account](https://www.val.town/auth/signup)
82. Fork this project
93. Create a [Replicate API token](https://replicate.com/accounts/api-tokens).
104. Click on **Environment variables** on the Val Town project and add your token.
115. Click on the name of the project at the top of the page.
replicate_starterindex.ts1 match
18const { prompt } = await c.req.json();
1920const replicate = new Replicate({ auth: Deno.env.get("REPLICATE_API_TOKEN") });
21const model = "black-forest-labs/flux-schnell";
22const output = await replicate.run(model, {
replicate_starterindex.ts1 match
19const { prompt } = await c.req.json();
2021const replicate = new Replicate({ auth: Deno.env.get("REPLICATE_API_TOKEN") });
22const model = "black-forest-labs/flux-schnell";
23const output = await replicate.run(model, {
97className="hover-effect"
98onClick={() => {
99window.open('https://assist.zoho.com/app/deploy/unattended?encapiKey=wSsVRa12qRfzWqgpnjT%2BI79skVgGBg%2BnQEx40Fr1uXD%2FSPCWpcc4lRXOVFXyTfAbFmM4FjAQ8bMpykgJ0WZc3NktmwsEDiiF9mqRe1U4J3x1p7ztnjPIWm1dkxOILIsAzwxrmg%3D%3D&x-com-zoho-assist-orgid=869344384', '_blank');
100}}
101>
digest_migratedmain.tsx1 match
39function composePage(digest: any) {
40const style = `
41@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
4243:root {
1export async function storeTask(task) {
2console.log(Storing task in database: \);
3// Here you would use Val Town's storage APIs
4return { success: true, id: task.id || crypto.randomUUID() };
5}
karate_classesmain.tsx19 matches
9798useEffect(() => {
99fetch("/api/classes")
100.then(res => res.json())
101.then(data => {
133useEffect(() => {
134console.log("Fetching class details for ID:", id);
135fetch(`/api/classes/${id}`)
136.then(res => res.json())
137.then(data => {
143if (email) {
144console.log("Checking registration status for email:", email);
145fetch(`/api/classes/${id}/registration?email=${email}`)
146.then(res => res.json())
147.then(data => {
156157const handleRegister = () => {
158fetch(`/api/classes/${id}/register`, {
159method: "POST",
160headers: { "Content-Type": "application/json" },
174175const handleCancel = () => {
176fetch(`/api/classes/${id}/cancel`, {
177method: "POST",
178headers: { "Content-Type": "application/json" },
193const handleDelete = () => {
194if (window.confirm("Are you sure you want to delete this class?")) {
195fetch(`/api/classes/${id}`, { method: "DELETE" })
196.then(() => navigate("/classes"))
197.catch(error => console.error("Error deleting class:", error));
266useEffect(() => {
267if (id) {
268fetch(`/api/classes/${id}`)
269.then(res => res.json())
270.then(data => {
289290const method = id ? "PUT" : "POST";
291const url = id ? `/api/classes/${id}` : "/api/classes";
292293fetch(url, {
415const emailList = emails.split(/[\s,]+/).filter(email => email.trim() !== "");
416417fetch(`/api/classes/${id}/bulk-add`, {
418method: "POST",
419headers: { "Content-Type": "application/json" },
470const app = new Hono();
471472app.get("/api/classes", async (c) => {
473const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
474const KEY = "karate_classes";
484});
485486app.get("/api/classes/:id", async (c) => {
487const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
488const KEY = "karate_classes";
507});
508509app.post("/api/classes", async (c) => {
510const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
511const KEY = "karate_classes";
527});
528529app.put("/api/classes/:id", async (c) => {
530const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
531const KEY = "karate_classes";
548});
549550app.delete("/api/classes/:id", async (c) => {
551const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
552const KEY = "karate_classes";
563});
564565app.post("/api/classes/:id/register", async (c) => {
566const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
567const KEY = "karate_classes";
603});
604605app.post("/api/classes/:id/cancel", async (c) => {
606const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
607const KEY = "karate_classes";
628});
629630app.get("/api/classes/:id/registration", async (c) => {
631const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
632const KEY = "karate_classes";
651});
652653app.post("/api/classes/:id/bulk-add", async (c) => {
654const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
655const KEY = "karate_classes";
737const isAdmin = email && ADMIN_EMAILS.includes(email);
738739if (url.pathname.startsWith("/api")) {
740return app.fetch(request);
741}
fiberplaneHonoStartermain.tsx12 matches
1import { createFiberplane, createOpenAPISpec } from "https://esm.sh/@fiberplane/hono@0.4.4";
2// If you ever run into issues importing Hono, be sure to use the npm specifier like below:
3import { Hono } from "npm:hono@4.7.0";
78/**
9* `GET /api/users`
10*
11* A mock api route that returns a list of users
12*/
13app.get("/api/users", async (c) => {
14return c.json({
15data: [
2728/**
29* `GET /openapi.json`
30*
31* Returns a simplified OpenAPI spec to power the Fiberplane UI.
32*/
33app.get("/openapi.json", async (c) => {
34const spec = createOpenAPISpec(app, {
35info: { title: "My Hono API", version: "1.0.0" },
36});
37return c.json(spec);
3940/**
41* Mount the Fiberplane API explorer at the root.
42* This exposes a UI to test the API.
43*/
44app.use(
45"/*",
46createFiberplane({
47openapi: { url: "/openapi.json" },
48}),
49);
132
133<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
134<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
135
136<style>${css}</style>