Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg?q=fetch&page=181&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 10673 results for "fetch"(961ms)

cardamumApp.tsx13 matches

@feb•Updated 1 week ago
37
38 if (roomId && playerId && gameState?.gameStarted && !gameState?.gameOver) {
39 interval = setInterval(fetchGameState, 3000) as unknown as number;
40 }
41
45 }, [roomId, playerId, gameState?.gameStarted, gameState?.gameOver]);
46
47 // Fetch the current game state
48 const fetchGameState = async () => {
49 try {
50 const response = await fetch(`${API_ENDPOINTS.GAME_STATE}?roomId=${roomId}&playerId=${playerId}`);
51 const data = await response.json();
52
54 setGameState(data.gameState);
55 } else {
56 setError(data.error || "Failed to fetch game state");
57 }
58 } catch (err) {
59 setError("Network error while fetching game state");
60 }
61 };
72
73 try {
74 const response = await fetch(API_ENDPOINTS.CREATE_ROOM, {
75 method: "POST",
76 headers: {
112
113 try {
114 const response = await fetch(API_ENDPOINTS.JOIN_ROOM, {
115 method: "POST",
116 headers: {
124 if (data.success) {
125 setMessage("Joined the room successfully!");
126 fetchGameState();
127 } else {
128 setError(data.error || "Failed to join room");
141
142 try {
143 const response = await fetch(API_ENDPOINTS.START_GAME, {
144 method: "POST",
145 headers: {
184
185 try {
186 const response = await fetch(API_ENDPOINTS.PLAY_CARD, {
187 method: "POST",
188 headers: {
220
221 try {
222 const response = await fetch(API_ENDPOINTS.DRAW_CARD, {
223 method: "POST",
224 headers: {
248
249 try {
250 const response = await fetch(API_ENDPOINTS.CALL_UNO, {
251 method: "POST",
252 headers: {

funappRegisterForm.vue2 matches

@fufunahimana•Updated 1 week ago
80
81 try {
82 const res = await fetch('http://localhost:8000/api/register/', {
83 method: 'POST',
84 headers: { 'Content-Type': 'application/json' },
109
110 try {
111 const res = await fetch('http://localhost:8000/api/send-verification-code/', {
112 method: 'POST',
113 headers: { 'Content-Type': 'application/json' },

funappLoginForm.vue1 match

@fufunahimana•Updated 1 week ago
38 async handleLogin() {
39 try {
40 const response = await fetch('http://localhost:8000/api/login/', {
41 method: 'POST',
42 headers: { 'Content-Type': 'application/json' },

funappcomplete_profile.html2 matches

@fufunahimana•Updated 1 week ago
222 const formData = new FormData(this);
223
224 fetch('{% url "profile" %}', {
225 method: 'POST',
226 body: formData,
248 deleteBtn.addEventListener('click', function() {
249 if (confirm('Are you sure you want to delete your profile? This action cannot be undone.')) {
250 fetch('{% url "profile" %}', {
251 method: 'DELETE',
252 headers: {

funappforgot_password.html2 matches

@fufunahimana•Updated 1 week ago
75 const email = document.getElementById('email').value;
76
77 fetch('{% url "forgot-password" %}', {
78 method: 'POST',
79 headers: {
112 }
113
114 fetch('{% url "reset-password" %}', {
115 method: 'POST',
116 headers: {

funappregister.html1 match

@fufunahimana•Updated 1 week ago
80
81 // Send verification code
82 fetch('{% url "send-verification-code" %}', {
83 method: 'POST',
84 headers: {

creationindex.ts1 match

@Funfulgence•Updated 1 week ago
47
48// Export the app for HTTP vals
49export default app.fetch;

Testindex.ts5 matches

@amardeeplakshkar•Updated 1 week ago
85 formData.append("pitch", "0"); // FreeConvert doesn't support pitch adjustment
86
87 const response = await fetch(url, {
88 method: "POST",
89 body: formData,
104 }
105
106 // Fetch the audio file
107 const audioResponse = await fetch(responseData.url);
108
109 if (!audioResponse.ok) {
110 throw new Error(`Failed to fetch audio: ${audioResponse.status}`);
111 }
112
156
157// Export the Hono app
158export default app.fetch;

Testscript.js3 matches

@amardeeplakshkar•Updated 1 week ago
11 const loadingOverlay = document.getElementById('loading-overlay');
12
13 // Fetch available voices
14 async function loadVoices() {
15 try {
16 const response = await fetch('/api/voices');
17 if (!response.ok) {
18 throw new Error('Failed to load voices');
99
100 try {
101 const response = await fetch('/api/tts', {
102 method: 'POST',
103 headers: {

isAgWebsiteDownmain.tsx2 matches

@ag_grid•Updated 1 week ago
21 start = performance.now();
22 try {
23 const res = await fetch(url);
24 end = performance.now();
25 status = res.status;
32 } catch (e) {
33 end = performance.now();
34 reason = `couldn't fetch: ${e}`;
35 ok = false;
36 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

FRAMERFetchBasic1 file match

@bresnik•Updated 8 hours ago

FetchBasic1 file match

@bresnik•Updated 8 hours ago