postherousREADME.md5 matches
2324### Backend (`/backend/`)
25- `index.ts` - Main Hono server with HTML generation and API routes ✅
26- `database/` - SQLite schema and query functions ✅
27- `services/` - External service integrations ✅
53- `ATPROTO_PASSWORD` - AT Protocol app password
5455## 📊 API Endpoints
5657- `GET /` - Main blog interface
58- `GET /post/:slug` - Individual post page
59- `GET /rss` - RSS 2.0 feed
60- `GET /api/posts` - JSON API for posts
61- `GET /api/posts/:slug` - JSON API for single post
62- `GET /websub` - WebSub subscription endpoint
63- `GET /.well-known/webfinger` - WebFinger discovery for ActivityPub ✅
67- `GET /following` - ActivityPub following collection ✅
68- `POST /inbox` - ActivityPub inbox (processes Follow, Like, Announce, Undo) ✅
69- `GET /api/posts/:slug/activities` - Get activity counts (likes, shares, replies) ✅
70- `GET /health` - Health check
71
assistant-requestmain.tsx3 matches
32let ivrData: any;
33try {
34const response = await fetch("https://ivr-api.withcherry.com/v3/users", {
35method: "POST",
36headers: {
5152if (!response.ok) {
53console.error("⚠️ IVR API error status:", response.status);
54return new Response("IVR Service Unavailable", { status: 503 });
55}
57ivrData = await response.json();
58} catch (err) {
59console.error("⚠️ IVR API fetch error:", err);
60return new Response("Internal Server Error", { status: 500 });
61}
github-apiindex.tsx6 matches
11getGitHubIssuesUpdatedSinceLastRun,
12getIssueContentAsMarkdown,
13} from "../api/index.tsx";
1415import { createGitHubClient } from "../shared/github-utils.ts";
59});
6061// API Routes with authentication
62app.get("/api/issues", requireAuth, async (c) => {
63try {
64const repoOwner = c.req.query("owner") || "oguzhanogreden";
83});
8485app.get("/api/issues/:number/content", requireAuth, async (c) => {
86try {
87const issueNumber = parseInt(c.req.param("number"));
103104// New endpoint with query parameter authentication
105app.get("/api/markdown/:number", async (c) => {
106try {
107const licenseKey = Deno.env.get("LICENSE_KEY");
131});
132133app.post("/api/agents/archiver", requireAuth, async (c: Context) => {
134try {
135const licenseKey = Deno.env.get("LICENSE_KEY");
postheroustest-activitypub-inbox.ts3 matches
89
90// Check activity counts for the post
91const activityResponse = await fetch(`${BASE_URL}/api/posts/test/activities`);
92if (activityResponse.ok) {
93const activityData = await activityResponse.json();
132
133// Check activity counts for the post
134const activityResponse = await fetch(`${BASE_URL}/api/posts/test/activities`);
135if (activityResponse.ok) {
136const activityData = await activityResponse.json();
205// Get final activity counts for test post
206try {
207const activityResponse = await fetch(`${BASE_URL}/api/posts/test/activities`);
208if (activityResponse.ok) {
209const activityData = await activityResponse.json();
github-apiApp.tsx2 matches
61try {
62const response = await fetch(
63`/api/agents/archiver?owner=${repoOwner}&repo=${repoName}&issueNumber=${selectedIssue.number}`,
64{
65method: "POST",
91try {
92const response = await fetch(
93`/api/issues?owner=${repoOwner}&repo=${repoName}`,
94{
95headers: {
18const loadEventDetails = async () => {
19try {
20const response = await fetch(`/api/${eventId}`);
21if (!response.ok) throw new Error('Failed to load event details');
22const data: EventDetailsResponse = await response.json();
rust-nyc-event-signinApp.tsx2 matches
61return (
62<>
63<link rel="preconnect" href="https://fonts.googleapis.com" />
64<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
65<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet" />
66
67<style>{`
github-apiknowledge.md13 matches
13- Generate code in TypeScript or TSX
14- Add appropriate TypeScript types and interfaces for all data structures
15- Prefer official SDKs or libraries than writing API calls directly
16- Ask the user to supply API or library documentation if you are at all unsure about it
17- **Never bake in secrets into the code** - always use environment variables
18- Include comments explaining complex logic (avoid commenting obvious operations)
23### 1. HTTP Trigger
2425- Create web APIs and endpoints
26- Handle HTTP requests and responses
27- Example structure:
173However, it's *extremely importing* to note that `parseProject` and other Standard Library utilities ONLY RUN ON THE SERVER.
174If you need access to this data on the client, run it in the server and pass it to the client by splicing it into the HTML page
175or by making an API request for it.
176177## Val Town Platform Specifics
181- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
182- **Storage:** DO NOT use the Deno KV module for storage
183- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
184- **Weather Data:** Use open-meteo for weather data (doesn't require API keys) unless otherwise specified
185- **View Source:** Add a view source link by importing & using `import.meta.url.replace("ems.sh", "val.town)"` (or passing this data to the client) and include `target="_top"` attribute
186- **Error Debugging:** Add `<script src="https://esm.town/v/std/catch"></script>` to HTML to capture client-side errors
187- **Error Handling:** Only use try...catch when there's a clear local resolution; Avoid catches that merely log or return 500s. Let errors bubble up with full context
188- **Environment Variables:** Use `Deno.env.get('keyname')` when you need to, but generally prefer APIs that don't require keys
189- **Imports:** Use `https://esm.sh` for npm and Deno dependencies to ensure compatibility on server and browser
190- **Storage Strategy:** Only use backend storage if explicitly required; prefer simple static client-side sites
224### Backend (Hono) Best Practices
225226- Hono is the recommended API framework
227- Main entry point should be `backend/index.ts`
228- **Static asset serving:** Use the utility functions to read and serve project files:
248});
249```
250- Create RESTful API routes for CRUD operations
251- Always include this snippet at the top-level Hono app to re-throwing errors to see full stack traces:
252```ts
285- For files in the project, use `readFile` helpers
2862875. **API Design:**
288- `fetch` handler is the entry point for HTTP vals
289- Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
299## Retrieving GitHub Issue Content as Markdown
300301The new functionality added in the GitHub API library allows developers to fetch a specific issue's content from a GitHub repository and format it in Markdown. This includes both the issue's main description and all comments associated with that issue, with any URLs present in the text also extracted and listed.
302303### Function Overview
328329```tsx
330import { getIssueContentAsMarkdown } from 'https://esm.town/v/cricks_unmixed4u/github-api/api/index.tsx?v=30'; // Ensure to use the correct version based on the function declaration.
331332async function displayIssueContent() {
358This new functionality streamlines the process of retrieving and displaying GitHub issue content and enhances collaboration and visibility in development environments.
359360# DONE: Next Step 1 - Export a new function from api
361362The new function should return the relevant content of a given issue in markdown format.
24run: vt push
25env:
26VAL_TOWN_API_KEY: ${{ secrets.VAL_TOWN_API_KEY }}
27
22}
2324// API request/response types
25export interface CreateEventRequest {
26name: string;