-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
66 lines (61 loc) · 2.16 KB
/
next.config.js
File metadata and controls
66 lines (61 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/** @type {import('next').NextConfig} */
const path = require('path')
const removeImports = require('next-remove-imports')();
const envConfig = {
development: {
NEXT_PUBLIC_CHAIN_ID: '421614',
NEXT_PUBLIC_NETWORK_URL: 'http://125.88.184.105:8545',
NEXT_PUBLIC_API_ROOT: 'http://180.163.81.72:13884',
USER_POOL_SERVICE_ROOT: 'http://125.88.184.105:8123',
NEXT_PUBLIC_USER_POOL_SERVICE_ROOT: "http://1.94.21.99:13884"
},
production: {
NEXT_PUBLIC_CHAIN_ID: '1337',
NEXT_PUBLIC_NETWORK_URL: 'https://node.inferer.xyz',
NEXT_PUBLIC_API_ROOT: 'https://api10.inferer.xyz',
USER_POOL_SERVICE_ROOT: 'http://125.88.184.105:8123',
NEXT_PUBLIC_USER_POOL_SERVICE_ROOT: "http://1.94.21.99:13884"
}
}
const isDev = process.env.NODE_ENV === 'development'
// next.config.js
const isProduction = process.env.NODE_ENV === 'production';
// const isDev = true
const nextConfig = {
reactStrictMode: false,
experimental: {
scrollRestoration: true,
},
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
env: {
BUILD_ENV: process.env.NODE_ENV || 'development',
...envConfig[process.env.NODE_ENV]
},
async rewrites() {
return [
{
source: '/api/identity/:path*',
// destination: `https://api8.inferer.xyz/api/identity/:path*`
destination: isDev ? `http://49.234.51.249:13882/api/identity/:path*` : `https://api8.inferer.xyz/api/identity/:path*`
},
{
source: '/api/trends/:path*',
// destination: `http://49.234.51.249:8792/api/:path*`
destination: isDev ? `http://49.234.51.249:8792/api/trends/:path*` : `https://api7.inferer.xyz/api/trends/:path*`
},
{
source: '/plugin/:path*',
destination: isDev ? `http://49.234.51.249:8792/plugin/:path*` : `https://api7.inferer.xyz/plugin/:path*`
},
{
source: '/api/admerkle/:path*',
// destination: `https://api8.inferer.xyz/api/identity/:path*`
destination: isDev ? `http://125.88.184.105:8123/api/admerkle/:path*` : `http://125.88.184.105:8123/api/admerkle/:path*`
},
]
},
}
// http://49.234.51.249:8792
module.exports = removeImports(nextConfig)