Embded frontend inside go binary

This will simplify the self hosting of the platform.

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-09 15:30:28 +01:00
parent 2c82dbad39
commit 123a538d82
40 changed files with 527 additions and 262 deletions

View File

@@ -11,7 +11,7 @@ const fetchRelay: FetchFunction = async (
request,
variables,
_,
uploadables,
uploadables
) => {
const requestInit: RequestInit = {
method: "POST",
@@ -27,7 +27,7 @@ const fetchRelay: FetchFunction = async (
operationName: request.name,
query: request.text,
variables: variables,
}),
})
);
const uploadableMap: {
@@ -59,7 +59,10 @@ const fetchRelay: FetchFunction = async (
});
}
const response = await fetch(buildEndpoint("/console/v1/query"), requestInit);
const response = await fetch(
buildEndpoint("/api/console/v1/query"),
requestInit
);
const json = await response.json();
@@ -68,8 +71,8 @@ const fetchRelay: FetchFunction = async (
`Error fetching GraphQL query '${
request.name
}' with variables '${JSON.stringify(variables)}': ${JSON.stringify(
json.errors,
)}`,
json.errors
)}`
);
}