Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/web/.env.example

This file was deleted.

4 changes: 0 additions & 4 deletions packages/web/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
interface ImportMetaEnv {
readonly VITE_DRFED_URL: string;
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
8 changes: 7 additions & 1 deletion packages/web/src/RelayEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ const fetchFn: FetchFunction = async (params, variables) => {
if (accessToken !== undefined) {
headers.Authorization = `Bearer ${accessToken}`;
}
const response = await fetch(import.meta.env.VITE_DRFED_URL, {

const url = new URL(
"/graphql",
event?.request.url ?? globalThis.location.href,
);

const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify({
Expand Down
11 changes: 10 additions & 1 deletion packages/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ import relay from "vite-plugin-relay-lite";
export default defineConfig(({ command }) => ({
plugins: [
solidStart(),
nitro(),
nitro({
routeRules: {
"/graphql": {
proxy: {
to: "http://127.0.0.1:8888/graphql",
forwardHeaders: ["accept"],
},
},
},
}),
relay({ codegen: command !== "build" }),
{
...cjsInterop({ dependencies: ["relay-runtime"] }),
Expand Down