reactHonoStarterindex.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
pushupappindex.html2 matches
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6<title>Push-Up Counter</title>
7<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
8<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
9<link rel="stylesheet" href="/styles.css">
10</head>
44// Load the face landmarks detection model
45model = await faceLandmarksDetection.load(
46faceLandmarksDetection.SupportedPackages.mediapipeFacemesh,
47{ maxFaces: 1 }
48);
stockAppScanBillView.tsx10 matches
3import {useState, useEffect} from "https://esm.sh/preact@10.19.6/hooks"
4import {User, SupplierBill, Product, Category, CreateProductPayload, SupplierBillItem as SharedSupplierBillItem, BillScanResponse} from "../../shared/types.ts"
5// import * as apiClient from "../apiClient.ts"; // Will be removed
67interface ScanBillViewProps {
19}
2021// Moved from apiClient.ts
22interface ConfirmBillFrontendPayload {
23reviewedItems: Array<{
33}>
34}
35const API_BASE_URL = "/api"
3637const ScanBillView: FunctionComponent<ScanBillViewProps> = ({currentUser}) => {
50if (step === "review" && currentUser) {
51// Fetch products
52fetch(`${API_BASE_URL}/products`, {
53headers: {"Accept": "application/json", "X-User-Id": currentUser.id}
54})
6768// Fetch categories
69fetch(`${API_BASE_URL}/categories`, {
70headers: {"Accept": "application/json", "X-User-Id": currentUser.id} // X-User-Id might not be strictly needed by backend for GET categories
71})
108109// Direct fetch for uploadBill
110let response = await fetch(`${API_BASE_URL}/bills/upload`, {
111method: "POST",
112headers: {
125126// Direct fetch for processBillAI
127response = await fetch(`${API_BASE_URL}/bills/process/${uploadResult.billId}`, {
128method: "POST",
129headers: {
139// The backend returns SupplierBill, but the AI service returns BillScanResponse.
140// The billService.processBillWithAI returns SupplierBill.
141// The apiClient.processBillAI was typed to return SupplierBill.
142// Let's assume the backend /api/bills/process/:billId returns SupplierBill
143const billData: SupplierBill = await response.json()
144219220// Direct fetch for confirmBill
221const response = await fetch(`${API_BASE_URL}/bills/${uploadedBillId}/confirm`, {
222method: "POST",
223headers: {
32backend.use("*", cors()) // Allow all origins for demo purposes
33backend.use("*", secureHeaders())
34// CSRF protection can be added if using cookie-based sessions, might be overkill for this API demo if using token auth
35// app.use("*", csrf());
3654// Error handler - Unwrap Hono errors to see original error details
55backend.onError((err, c) => {
56console.error("API Error:", err)
57// Check if it's an HTTPError from Hono, otherwise it's an internal error
58if (err && typeof err === 'object' && 'getResponse' in err && typeof err.getResponse === 'function') {
477// The payload for updateSupplierBillWithAIData expects a full BillScanResponse structure.
478// This might need a dedicated service method if the payload is different.
479console.warn(`PUT /api/bills/:billId - Manual bill update logic might need a dedicated service method. Reusing updateSupplierBillWithAIData for now if payload matches.`)
480const updatedBill = await db.updateSupplierBillWithAIData(billId, payload as BillScanResponse, userId) // Casting payload, ensure it's compatible
481
stockAppinventoryApp.http.tsx2 matches
5// import {serveStatic} from "https://esm.sh/hono@4.4.6/deno" // Unused and causing error
6import {readFile, parseProject} from "https://esm.town/v/std/utils@85-main/index.ts" // Val Town utils
7import backendRoutes from "./backend/api.ts"
8const app = new Hono()
9949596app.route("/api", backendRoutes)
9798
bluesky-thinkup-tributewatcher.tsx2 matches
1import { email } from "https://esm.town/v/std/email?v=13";
2import { sqlite } from "https://esm.town/v/std/sqlite2?v=1";
3import { AtpAgent, AtpSessionData, AtpSessionEvent } from "npm:@atproto/api";
4import diff from "npm:fast-diff@1.3.0";
52627// Supports up to 5,000 (100*50) follows, stopping there to try
28// and avoid rate limits. These APIs have pretty low limits, sound off here
29// https://github.com/bluesky-social/atproto/discussions/3356
30outerLoop: for (let i = 0; i < 20; i++) {
bluesky-thinkup-tributeREADME.md2 matches
18I was an avid user of [ThinkUp](https://www.thinkupapp.com/), a tool that connected to Twitter and sent me a daily email with profile updates from all the people I followed. I found it useful in work and for fun. Maybe one of my friends switched jobs or changed their username to something goofy or political. I want to know! In the distant past Facebook would include profile updates in the newsfeed: why not that for Twitter? ThinkUp did some other cool stuff, like providing full archives of Tweets in a more convenient format than Twitter did themselves.
1920But Twitter [is bad now](https://macwright.com/2025/03/04/twitter-eol) and ThinkUp [shut down in 2016](https://www.thinkupapp.com/) because [the APIs that they were relying on from Twitter, Facebook, and Instagram were all locked down and limited](https://medium.com/@anildash/the-end-of-thinkup-e600bc46cc56). How disappointing.
2122But there's a new social network in town, [Bluesky](https://bsky.app/), and it's ~~impossible~~ somewhat more difficult to corrupt and enshittify than those networks were, and it comes with a pretty good, if sometimes weird API that gives you access to everything you need.
2324Could you build some of ThinkUp on Bluesky? Yes. This is it.
sa_pmtindex.html2 matches
126// Get the base URL to handle any path prefixes
127const baseUrl = new URL(window.location.href).origin;
128const apiUrl = `${baseUrl}/api/enhance`;
129
130const response = await fetch(apiUrl, {
131method: 'POST',
132headers: {
22app.get("/frontend/*", (c) => serveFile(c.req.path, import.meta.url));
2324// API endpoint to enhance prompts
25app.post("/api/enhance", async (c) => {
26try {
27const body = await c.req.json().catch(() => ({}));
68});
69} catch (openaiError) {
70console.error("OpenAI API error:", openaiError);
71return c.json({
72error: "OpenAI service error",