Commit 8d2fe420 authored by ChanHaeng Lee's avatar ChanHaeng Lee
Browse files

Able to lookup

parent c40b3b0d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -19,8 +19,9 @@
    "lint": "eslint ."
  },
  "dependencies": {
    "@fedify/fedify": "workspace:^",
    "@fedify/sveltekit": "workspace:^"
    "@fedify/fedify": "workspace:",
    "@fedify/sveltekit": "workspace:",
    "x-forwarded-fetch": "^0.2.0"
  },
  "devDependencies": {
    "@eslint/compat": "^1.2.5",
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ import {
  Person,
  Undo,
} from "@fedify/fedify";
import { keyPairsStore, relationStore } from "@/data/store";
import { keyPairsStore, relationStore } from "../data/store";

const federation = createFederation({
  kv: new MemoryKvStore(),
+10 −0
Original line number Diff line number Diff line
import { fedifyHook } from "@fedify/sveltekit";
import federation from "./federation";
import { sequence } from "@sveltejs/kit/hooks";
import { replaceHost } from "./lib/handles";
import type { Handle } from "@sveltejs/kit";

export const handle = sequence(
  replaceHost,
  fedifyHook(federation, () => {}) as unknown as Handle,
);
+14 −0
Original line number Diff line number Diff line
import type { Handle } from "@sveltejs/kit";
import { getXForwardedRequest } from "x-forwarded-fetch";

/**
 * Replaces the host of the request with the value of the
 * x-forwarded-host header, if present.
 * If don't use proxy or tunnel, this handle is unnecessary.
 * @param input
 * @return A new request handler with the host replaced.
 */
export const replaceHost: Handle = async ({ event, resolve }) => {
  event.request = await getXForwardedRequest(event.request);
  return resolve(event);
};
+1 −9
Original line number Diff line number Diff line
@@ -9,14 +9,6 @@
    "skipLibCheck": true,
    "sourceMap": true,
    "strict": true,
    "moduleResolution": "bundler",
    "paths": {
      "@/*": ["./src/*"]
    "moduleResolution": "bundler"
  }
}
  // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
  // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
  //
  // To make changes to top-level options such as include and exclude, we recommend extending
  // the generated config; see https://svelte.dev/docs/kit/configuration#typescript
}
Loading