Skip to content

Commit

Permalink
Redirect page endpoints to embed
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed Dec 3, 2024
1 parent 6c5d5a3 commit 5147167
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/routes/(app)/documents/[id]/pages/[page]/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { redirect } from "@sveltejs/kit";

import { EMBED_URL } from "@/config/config.js";

// redirect to embed route
export function load({ url }) {
const u = new URL(url);

u.searchParams.set("embed", "1");
u.hostname = EMBED_URL;

return redirect(302, u);
}

0 comments on commit 5147167

Please sign in to comment.