val_to_project_converterredirect.ts4 matches
20}
2122const { apiKey, originalVals, projectName, username } = body;
2324console.log("Received redirect request:", {
28});
2930if (!apiKey) {
31return new Response(JSON.stringify({ error: "API key is required" }), {
32status: 400,
33headers: { "Content-Type": "application/json" },
49}
5051const result = await redirectOriginalVals(apiKey, originalVals, projectName, username);
5253return new Response(JSON.stringify(result), {
farcasterFlingsmain.tsx1 match
2let FARCASTER_USERNAME = "whatrocks";
3let flings = await fetch(
4`https://searchcaster.xyz/api/search?regex=%E2%8C%86&username=${FARCASTER_USERNAME}`,
5).then((res) => res.json());
6let filteredCasts = flings.casts.filter((cast) => cast.body.data.text[0] === "⌆");
GitHubSyncREADME.md3 matches
24- Ensure the token has read/write access to _Contents_ for the repo
25- Copy the access token and add that as the `GITHUB_TOKEN` env var in this val
261. Add a new [Val Town API token][] with read/write permissions. Add that token to the val's env vars as `VALTOWN_TOKEN`
271. Add a `VAL_SECRET` env var to the val. Use this secret to sign the webhook POST request to the `/push` endpoint. Use this endpoint to commit vals from Val Town to your GitHub repo.
286869- `GITHUB_TOKEN`: Read/write GitHub personal access token for reading and writing repo contents
70- `VALTOWN_TOKEN`: ValTown API token (with read/write Vals permissions) for writing updates from GitHub
71- `GITHUB_WEBHOOK_SECRET`: secret for verifying webhooks from GitHub
72- `VAL_SECRET`: secret for verifying requests to the `/push` endpoint
98[github oauth app]: https://github.com/settings/developers
99[access token]: https://github.com/settings/tokens
100[val town api token]: https://www.val.town/settings/api
101[troubleshooting]: #troubleshooting
102
reactHonoExample_toowiredApp.tsx2 matches
1819try {
20const response = await fetch("/api/research", {
21method: "POST",
22headers: { "Content-Type": "application/json" },
8687<div className="footer">
88<button onClick={() => window.open("/api/view-source", "_blank")} className="view-source">
89View Source
90</button>
poorvis885README.md1 match
1213Frontend: React 18, TailwindCSS
14APIs: Open-Meteo, OpenAI GPT-4o
15Hosting: ESM-based module imports
poorvis885main.tsx2 matches
47// Fetch weather data
48const weatherResponse = await fetch(
49`https://api.open-meteo.com/v1/forecast?latitude=${location.latitude}&longitude=${location.longitude}¤t_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`
50);
51const weatherData = await weatherResponse.json();
189setError('');
190try {
191const response = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${input}&count=1&language=en&format=json`);
192const data = await response.json();
193if (data.results && data.results.length > 0) {
weatherDashboardmain.tsx2 matches
47// Fetch weather data
48const weatherResponse = await fetch(
49`https://api.open-meteo.com/v1/forecast?latitude=${location.latitude}&longitude=${location.longitude}¤t_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`
50);
51const weatherData = await weatherResponse.json();
189setError('');
190try {
191const response = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${input}&count=1&language=en&format=json`);
192const data = await response.json();
193if (data.results && data.results.length > 0) {
weatherDashboardREADME.md1 match
1213Frontend: React 18, TailwindCSS
14APIs: Open-Meteo, OpenAI GPT-4o
15Hosting: ESM-based module imports
weatherDashboardmain.tsx1 match
12try {
13const response = await fetch(
14`https://api.open-meteo.com/v1/forecast?latitude=${location.lat}&longitude=${location.lon}¤t_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`,
15);
16const data = await response.json();
39};
4041const api = {
42get: async (url: string) => {
43const response = await fetch(url);
44if (!response.ok) throw new Error("API request failed");
45return response.json();
46},
51body: JSON.stringify(data),
52});
53if (!response.ok) throw new Error("API request failed");
54return response.json();
55},
60body: JSON.stringify(data),
61});
62if (!response.ok) throw new Error("API request failed");
63return response.json();
64},
65delete: async (url: string) => {
66const response = await fetch(url, { method: "DELETE" });
67if (!response.ok) throw new Error("API request failed");
68return response.json();
69},
236const fetchTodos = async () => {
237try {
238const data = await api.get("/todos");
239setTodos(data);
240} catch (error) {
268269try {
270await api.post("/todos", newTodo);
271fetchTodos();
272} catch (error) {
277const deleteTodo = async (id: number) => {
278try {
279await api.delete(`/todos/${id}`);
280fetchTodos();
281} catch (error) {
286const saveTodoEdits = async (editedTodo: Todo) => {
287try {
288await api.put(`/todos/${editedTodo.id}`, editedTodo);
289setEditingTodo(null);
290fetchTodos();
445<meta name="viewport" content="width=device-width, initial-scale=1.0">
446<title>Todo App</title>
447<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
448<style>${css}</style>
449</head>