Skip to content

Commit

Permalink
fix(selector): rewrites moved to proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewklau committed Oct 16, 2024
1 parent 535e3ef commit f850791
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
2 changes: 0 additions & 2 deletions apps/explorer-selector/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ NEXT_PUBLIC_NETWORK_ID=testnet
NEXT_PUBLIC_BOS_NETWORK=testnet
NEXT_PUBLIC_ACCOUNT_ID=nearblocks.testnet
NEXT_PUBLIC_LOADER_URL=http://127.0.0.1:3030
NEXT_PUBLIC_MAINNET_API_URL=http://mainnet-api.nearblocks.svc.cluster.local:3001/v1
NEXT_PUBLIC_TESTNET_API_URL=http://testnet-api.nearblocks-testnet.svc.cluster.local:3001/v1
57 changes: 0 additions & 57 deletions apps/explorer-selector/next.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
const { configureRuntimeEnv } = require('next-runtime-env/build/configure');
const path = require('path');
const { env } = require('next-runtime-env');

const network = env('NEXT_PUBLIC_NETWORK_ID');
const mainnetApiUrl =
env('NEXT_PUBLIC_MAINNET_API_URL') || 'https://api.nearblocks.io/v1';
const testnetApiUrl =
env('NEXT_PUBLIC_TESTNET_API_URL') || 'https://api-testnet.nearblocks.io/v1';
configureRuntimeEnv();

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand All @@ -23,54 +14,6 @@ const nextConfig = {

return config;
},
async rewrites() {
return [
{
source: '/api/nodes',
destination:
network === 'mainnet'
? `${mainnetApiUrl}/node/telemetry`
: `${testnetApiUrl}/node/telemetry`,
},
/*
{
source: '/api/circulating-supply',
destination:
network === 'mainnet'
? `${mainnetApiUrl}/legacy/circulating-supply`
: `${testnetApiUrl}/legacy/circulating-supply`,
},
*/
{
source: '/api/circulating-supply-in-near',
destination:
network === 'mainnet'
? `${mainnetApiUrl}/legacy/circulating-supply?unit=near`
: `${testnetApiUrl}/legacy/circulating-supply?unit=near`,
},
{
source: '/api/fees-of-previous-day-utc',
destination:
network === 'mainnet'
? `${mainnetApiUrl}/legacy/fees?period=day`
: `${testnetApiUrl}/legacy/fees?period=day`,
},
{
source: '/api/fees-of-previous-7-days-utc',
destination:
network === 'mainnet'
? `${mainnetApiUrl}/legacy/fees?period=week`
: `${testnetApiUrl}/legacy/fees?period=week`,
},
{
source: '/api/ping',
destination:
network === 'mainnet'
? `${mainnetApiUrl}/legacy/ping`
: `${testnetApiUrl}/legacy/ping`,
},
];
},
};

module.exports = nextConfig;

0 comments on commit f850791

Please sign in to comment.