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: [
reactHonoStarterindex.ts2 matches
15app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
1617// Add your API routes here
18// app.get("/api/data", c => c.json({ hello: "world" }));
1920// Unwrap and rethrow Hono errors as the original error
fiberplaneHonoStartermain.tsx12 matches
1import { createFiberplane, createOpenAPISpec } from "https://esm.sh/@fiberplane/hono@0.5.1";
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);
fiberplaneHonoStarterREADME.md13 matches
1Example Hono app with a Fiberplane API explorer.
23> For an example with `OpenApiHono`, see: https://www.val.town/x/fiberplane/fiberplaneHonoZodStarter
451. Import `@fiberplane/hono`
7import {
8createFiberplane,
9createOpenAPISpec
10} from "https://esm.sh/@fiberplane/hono@0.5.1";
11```
12132. Generate a simplified API spec (if you don't already have one)
14```ts
15app.get("/openapi.json", async (c) => {
16const spec = createOpenAPISpec(app, {
17info: { title: "My Hono API", version: "1.0.0" },
18});
19return c.json(spec);
21```
22233. Mount the api explorer
2425This will mount it at the root `/*`, but you can mount it to another route, like `/fp/*` if you
26are using `/` for your main app. We recommend `/` if your Hono app is an API without a frontend.
2728```ts
30"/*",
31createFiberplane({
32openapi: { url: "/openapi.json" },
33}),
34);
35```
36374. Visit your Val's root route to play with the API explorer!
3839## How it Works
4041`createFiberplane` mounts Fiberplane on your app at the specified path, which can be used to explore the api's routes and make requests.
42Think of it like an embedded, lightweigh postman.
434445If you don't have an API spec at the ready, then the `createOpenAPISpec` utility helps create a simple OpenAPI spec from all routes in the application.
46(_Note that this simple spec does not include information on expected query parameters, headers, or payloads!_)
47
1import { IIIFBuilder } from "npm:@iiif/builder";
23const privateApiUrl = "https://data.4tu.nl/v2/account/articles";
4const publicApiUrl = "https://data.4tu.nl/v2/articles";
5const iiifBaseUrl = "https://data.4tu.nl/iiif/v3/";
625});
26manifest.setSeeAlso([{
27id: `${publicApiUrl}/${uuid}`,
28type: "Dataset",
29label: { "en": ["Djehuty API"] },
30format: "application/json",
31profile: "https://djehuty.4tu.nl/#x1-490005",
71}
72const token = params.get("token");
73const metadata = await fetchJson((token ? privateApiUrl : publicApiUrl) + "/" + datasetUuid, token);
74// return Response.json(metadata);
75if (!metadata) {
aBeautifulMindindex.ts2 matches
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
1314// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
1617// Unwrap and rethrow Hono errors as the original error
twitterAlertREADME.md4 matches
31Refer to [Twitter's search operators](https://socialdata.gitbook.io/docs/twitter-tweets/retrieve-search-results-by-keyword#endpoint-parameters) to fine-tune your query.
3233### 4. Test API call
34Set `isProd = false` in the code if you are testing, to ensure there are enough tweets to display. <br>
35Toggle it back to `true` when you're ready to run this cron job in production and actuall send notifications.
6061### NOTE: Usage Limits
62This val uses the SocialData API for Twitter data:
6364- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.
blob_adminmain.tsx25 matches
73const menuRef = useRef(null);
74const isPublic = blob.key.startsWith("__public/");
75const publicUrl = isPublic ? `${window.location.origin}/api/public/${encodeURIComponent(blob.key.slice(9))}` : null;
7677useEffect(() => {
237setLoading(true);
238try {
239const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
240const data = await response.json();
241setBlobs(data);
264setBlobContentLoading(true);
265try {
266const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
267const content = await response.text();
268setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
278const handleSave = async () => {
279try {
280await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
281method: "PUT",
282body: editContent,
290const handleDelete = async (key) => {
291try {
292await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
293setBlobs(blobs.filter(b => b.key !== key));
294if (selectedBlob && selectedBlob.key === key) {
307const key = `${searchPrefix}${file.name}`;
308formData.append("key", encodeKey(key));
309await fetch("/api/blob", { method: "POST", body: formData });
310const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
311setBlobs([newBlob, ...blobs]);
329try {
330const fullKey = `${searchPrefix}${key}`;
331await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
332method: "PUT",
333body: "",
344const handleDownload = async (key) => {
345try {
346const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
347const blob = await response.blob();
348const url = window.URL.createObjectURL(blob);
363if (newKey && newKey !== oldKey) {
364try {
365const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
366const content = await response.blob();
367await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
368method: "PUT",
369body: content,
370});
371await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
372setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
373if (selectedBlob && selectedBlob.key === oldKey) {
383const newKey = `__public/${key}`;
384try {
385const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
386const content = await response.blob();
387await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
388method: "PUT",
389body: content,
390});
391await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
392setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
393if (selectedBlob && selectedBlob.key === key) {
402const newKey = key.slice(9); // Remove "__public/" prefix
403try {
404const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
405const content = await response.blob();
406await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
407method: "PUT",
408body: content,
409});
410await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
411setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
412if (selectedBlob && selectedBlob.key === key) {
557onClick={() =>
558copyToClipboard(
559`${window.location.origin}/api/public/${encodeURIComponent(selectedBlob.key.slice(9))}`,
560)}
561className="text-blue-400 hover:text-blue-300 text-sm"
580>
581<img
582src={`/api/blob?key=${encodeKey(selectedBlob.key)}`}
583alt="Blob content"
584className="max-w-full h-auto"
660661// Public route without authentication
662app.get("/api/public/:id", async (c) => {
663const key = `__public/${c.req.param("id")}`;
664const { blob } = await import("https://esm.town/v/std/blob");
778};
779780app.get("/api/blobs", checkAuth, async (c) => {
781const prefix = c.req.query("prefix") || "";
782const limit = parseInt(c.req.query("limit") || "20", 10);
787});
788789app.get("/api/blob", checkAuth, async (c) => {
790const key = c.req.query("key");
791if (!key) return c.text("Missing key parameter", 400);
795});
796797app.put("/api/blob", checkAuth, async (c) => {
798const key = c.req.query("key");
799if (!key) return c.text("Missing key parameter", 400);
804});
805806app.delete("/api/blob", checkAuth, async (c) => {
807const key = c.req.query("key");
808if (!key) return c.text("Missing key parameter", 400);
812});
813814app.post("/api/blob", checkAuth, async (c) => {
815const { file, key } = await c.req.parseBody();
816if (!file || !key) return c.text("Missing file or key", 400);
capitalMultipliersmain.tsx6 matches
74<div className="popup-content">
75<div className="popup-header">
76<h2 className="popup-title">Capital Multipliers</h2>
77<p className="popup-subtitle">Your Financial Growth Partner</p>
78</div>
116<header className="hero-section">
117<div className="hero-content">
118<h1 className="hero-title">Capital Multipliers</h1>
119<p className="hero-subtitle">Transforming Investments, Maximizing Returns Since 1989</p>
120</div>
187<div className="contact-actions">
188<a href="tel:+918358025813" className="contact-btn">📞 Call Now</a>
189<a href="mailto:capitalmultipliers89@gmail.com" className="contact-btn">✉️ Email Us</a>
190</div>
191</section>
192193<footer className="site-footer">
194<p>© 2023 Capital Multipliers. All Rights Reserved.</p>
195</footer>
196</div>
542<head>
543<meta charset="UTF-8">
544<title>Capital Multipliers - Expert Market Analysis</title>
545<meta name="description" content="Maximize your profits with expert share market advisory services">
546<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
547<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap" rel="stylesheet">
548<style>${css}</style>
549</head>
wikidataredirectormain.tsx1 match
7* 3. Automatically redirect to the first website if only one exists
8*
9* Uses Wikidata's EntityData API to fetch website information
10*/
11import { Hono } from 'npm:hono';