forked from
rocksky.app/rocksky
A decentralized music tracking and discovery platform built on AT Protocol 馃幍
1/**
2 * Welcome to Cloudflare Workers! This is your first worker.
3 *
4 * - Run `npm run dev` in your terminal to start a development server
5 * - Open a browser tab at http://localhost:8787/ to see your worker in action
6 * - Run `npm run deploy` to publish your worker
7 *
8 * Bind resources to your worker in `wrangler.jsonc`. After adding bindings, a type definition for the
9 * `Env` object can be regenerated with `npm run cf-typegen`.
10 *
11 * Learn more at https://developers.cloudflare.com/workers/
12 */
13
14export default {
15 async fetch(request, env, ctx): Promise<Response> {
16 /*const url = new URL(request.url);
17 const proxyUrl = new URL(request.url);
18 proxyUrl.host = "rocksky.apidog.io";
19 proxyUrl.hostname = "rocksky.apidog.io";
20 // set headers
21 const headers = new Headers(request.headers);
22 headers.set("X-Apidog--Docs-Site-ID", "rocksky");
23 return fetch(proxyUrl.toString(), {
24 method: request.method,
25 headers,
26 });*/
27
28 // redirect to fmqouwwzmr.apidog.io
29 return Response.redirect("https://docs.rocksky.app", 301);
30 },
31} satisfies ExportedHandler<Env>;