Closed AdalynBlack closed 9 months ago
@TonyGamer dude what is the new fucking URL. You can save my asshole by telling me that!
@adgsenpai your asshole is saved
@adgsenpai your asshole is saved
I'm talking about the episode endpoint?
/api/v1/episode/one-piece
and also streaming end point
For example doesn't work?
I self host it on animeapiv2.adgstudios.co.za
My observation is that the streaming works but the episodes metadata doesn't work on the owners website?
That's fine I'll play around. I got the other GraphQL stuff giving me the data.
Thanks guys for letting me know.
Wtf it seems like it's back up FFS
I'm over the moon 🌙 🌚 ✨️
Back to patching
Okay status update i think the dudes server just got that requests cached :-( still fails.
Okay guys your really did save my asshole. I think the dev never just update the production api etc.
My assumption his that the vercel account has the CD/CI updates. i do see the other guys website is back up. Just need to sort out my self hosting in the main while gonna leverage his domain to buy time lol. Thanks guys
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const url = new URL(request.url);
const apiURL = `https://api-amvstrm.vercel.app/${url.pathname}`;
let response;
switch (request.method) {
case 'GET':
response = await fetch(apiURL, { method: 'GET' });
break;
case 'POST':
response = await fetch(apiURL, {
method: 'POST',
headers: request.headers,
body: await request.text()
});
break;
default:
return new Response('Method not allowed', { status: 405 });
}
// Add CORS headers to the response
const headers = new Headers(response.headers);
headers.set('Access-Control-Allow-Origin', 'https://anime.adgstudios.co.za');
headers.set('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
headers.set('Access-Control-Allow-Headers', request.headers.get('Access-Control-Request-Headers'));
// Create a new response with the added headers
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: headers
});
}
My cloudflare worker code
This route is broken
Streaming works
Everything is working 100%. Thanks to whatever people who contributed! This issue can be closed!
I already deploy my API with the new gogoanime domain both prod and public API, It seem that the data might be cache by the browser but now everything is working fine. If you have any problems I will help.
The current URL returns error 502. Switching to the updated URL seems to work perfectly fine