feat: use environment variable to specify proxyscotch access token (#2791)

This commit is contained in:
biondizzle
2022-10-29 18:16:40 -04:00
committed by GitHub
parent c67463fb3b
commit 79ada82223
3 changed files with 6 additions and 0 deletions

View File

@@ -26,3 +26,6 @@ VITE_BACKEND_WS_URL=wss://api.hoppscotch.io/graphql
# VITE_SENTRY_DSN: <Sentry DSN here>
# VITE_SENTRY_ENVIRONMENT: <Sentry environment value here>
# VITE_SENTRY_RELEASE_TAG: <Sentry release tag here (for release monitoring)>
# Proxyscotch Access Token (Optional)
# VITE_PROXYSCOTCH_ACCESS_TOKEN: <Token Set In Proxyscotch Server>

View File

@@ -29,6 +29,7 @@ const getProxyPayload = (
let payload: ProxyPayloadType = {
...req,
wantsBinary: true,
accessToken: import.meta.env.VITE_PROXYSCOTCH_ACCESS_TOKEN ?? "",
}
if (payload.data instanceof FormData) {

View File

@@ -24,6 +24,8 @@ interface ImportMetaEnv {
readonly VITE_SENTRY_DSN?: string
readonly VITE_SENTRY_ENVIRONMENT?: string
readonly VITE_SENTRY_RELEASE_TAG?: string
readonly VITE_PROXYSCOTCH_ACCESS_TOKEN?: string
}
interface ImportMeta {