Skip to content

Commit

Permalink
Merge pull request #4737 from wri/develop
Browse files Browse the repository at this point in the history
Deploy
  • Loading branch information
willian-viana authored Jan 9, 2024
2 parents ac616ff + 81844c0 commit ac3f800
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions pages/api/gfw/[...params].js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import httpProxyMiddleware from 'next-http-proxy-middleware';
import { GFW_API } from 'utils/apis';
import { PROXIES } from 'utils/proxies';

const GFW_API_KEY = process.env.NEXT_PUBLIC_GFW_API_KEY;

// We never use the `staging-api.resourcewatch.org`
const GFW_API_URL = GFW_API;

Expand All @@ -27,9 +25,6 @@ export default (req, res) =>
replaceStr: '/',
},
],
headers: {
'x-api-key': GFW_API_KEY,
},
followRedirects: true,
}).catch(async (error) => {
res.end(error.message);
Expand Down
12 changes: 0 additions & 12 deletions utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ const RESOURCE_WATCH_API_URL = RESOURCE_WATCH_API;

// At the moment, the API key is the same
const GFW_API_KEY = process.env.NEXT_PUBLIC_GFW_API_KEY;
const GFW_METADATA_API_KEY = GFW_API_KEY;
const DATA_API_KEY = GFW_API_KEY;
const RESOURCE_WATCH_API_KEY = GFW_API_KEY;

const isServer = typeof window === 'undefined';

Expand All @@ -41,9 +39,6 @@ export const apiRequest = create({
...defaultRequestConfig,
...(isServer && {
baseURL: GFW_API_URL,
headers: {
'x-api-key': GFW_API_KEY,
},
}),
...(!isServer && {
baseURL: PROXIES.GFW_API,
Expand All @@ -68,9 +63,6 @@ export const metadataRequest = create({
...defaultRequestConfig,
...(isServer && {
baseURL: GFW_METADATA_API_URL,
headers: {
'x-api-key': GFW_METADATA_API_KEY,
},
}),
...(!isServer && {
baseURL: PROXIES.METADATA_API,
Expand All @@ -81,9 +73,6 @@ export const rwRequest = create({
...defaultRequestConfig,
...(isServer && {
baseURL: RESOURCE_WATCH_API_URL,
headers: {
'x-api-key': RESOURCE_WATCH_API_KEY,
},
}),
...(!isServer && {
baseURL: PROXIES.RESOURCE_WATCH_API,
Expand All @@ -97,7 +86,6 @@ export const apiAuthRequest = create({
baseURL: GFW_API,
headers: {
'content-type': 'application/json',
'x-api-key': GFW_API_KEY,
},
}),
...(!isServer && {
Expand Down

0 comments on commit ac3f800

Please sign in to comment.