Skip to content

Commit

Permalink
fix: endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed Aug 24, 2023
1 parent f0ace4f commit da42d8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Sentry.init({
integrations: [
new Sentry.BrowserTracing({
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", "https:penguin-stats.io"],
tracePropagationTargets: ["localhost", "https://rogue.penguin-stats.io"],
}),
new Sentry.Replay(),
],
Expand Down
23 changes: 13 additions & 10 deletions src/services/relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ import { getToken, setToken } from "../utils/storage"

const fetchRelay: FetchFunction = async (params, variables) => {
console.debug("Relay request", params, variables)
const response = await fetch("http://localhost:3500/graphql", {
method: "POST",
headers: {
"content-type": "application/json",
...(getToken() && { authorization: `Bearer ${getToken()}` }),
const response = await fetch(
(import.meta.env.VITE_API_URL || "") + "/graphql",
{
method: "POST",
headers: {
"content-type": "application/json",
...(getToken() && { authorization: `Bearer ${getToken()}` }),
},
body: JSON.stringify({
query: params.text,
variables,
}),
},
body: JSON.stringify({
query: params.text,
variables,
}),
})
)

const newToken = response.headers.get("x-penguin-roguestats-set-token")
if (newToken) setToken(newToken)
Expand Down

0 comments on commit da42d8e

Please sign in to comment.