-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathnetlify.toml
More file actions
169 lines (143 loc) · 5.41 KB
/
netlify.toml
File metadata and controls
169 lines (143 loc) · 5.41 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
[build]
base = "packages/frontend"
command = "pnpm build:netlify"
publish = "build"
functions = "netlify/functions"
[build.environment]
NODE_VERSION = "24"
NODE_OPTIONS = "--max-old-space-size=4096"
# Enable build cache for faster deploys
NPM_FLAGS = "--prefer-offline --no-audit"
[context.production.environment]
VITE_CONTEXT = "production"
[context.deploy-preview.environment]
VITE_CONTEXT = "deploy-preview"
[context.branch-deploy.environment]
VITE_CONTEXT = "branch-deploy"
[dev]
command = "npm run dev"
port = 3002
targetPort = 3002
framework = "vite"
publish = "build"
autoLaunch = true
# Handle client-side routing
[[redirects]]
from = "/blocked.html"
to = "/blocked.html"
status = 200
conditions = {Country = [
"AF", "BY", "MM", "CF", "CU", "CD", "ET", "IR", "IQ", "LB", "LY", "ML", "NI", "KP", "RU", "SO", "SS", "SD", "VE", "YE", "ZW"
]}
[[redirects]]
from = "/blocked*"
to = "/"
status = 302
force = true
[[redirects]]
from = "/*"
to = "/blocked.html"
status = 302
force = true
conditions = {Country = [
"AF", "BY", "MM", "CF", "CU", "CD", "ET", "IR", "IQ", "LB", "LY", "ML", "NI", "KP", "RU", "SO", "SS", "SD", "VE", "YE", "ZW"
]}
[[redirects]]
from = "/api/hubspot"
to = "/.netlify/functions/hubspot"
status = 200
# Set immutable caching for static files FIRST (more specific rules should come first)
# These files have fingerprinted filenames so they can be cached forever
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31560000, immutable"
# Prevent caching of service worker and registration script
[[headers]]
for = "/sw.js"
[headers.values]
Cache-Control = "no-cache, no-store, must-revalidate"
Pragma = "no-cache"
Expires = "0"
[[headers]]
for = "/registerSW.js"
[headers.values]
Cache-Control = "no-cache, no-store, must-revalidate"
Pragma = "no-cache"
Expires = "0"
# Prevent caching of main entry point and manifest
[[headers]]
for = "/index.html"
[headers.values]
Cache-Control = "no-cache, no-store, must-revalidate"
Pragma = "no-cache"
Expires = "0"
[[headers]]
for = "/manifest.webmanifest"
[headers.values]
Cache-Control = "no-cache, no-store, must-revalidate"
Pragma = "no-cache"
Expires = "0"
# Cache favicon aggressively
[[headers]]
for = "/images/favicon.svg"
[headers.values]
Cache-Control = "public, max-age=31560000, immutable"
[[headers]]
for = "/version.json"
[headers.values]
Cache-Control = "no-store"
[[headers]]
for = "/announcements.json"
[headers.values]
Cache-Control = "no-store"
# Redirect US traffic from primary domain to US domain, preserving the path
[[redirects]]
from = "https://ambi-perps.netlify.app/*"
to = "https://ambi-perps-us.netlify.app/:splat"
status = 302
force = true
conditions = { Country = ["US"] }
# Redirect non-US traffic from US domain to primary domain, preserving the path
[[redirects]]
from = "https://ambi-perps-us.netlify.app/*"
to = "https://ambi-perps.netlify.app/:splat"
status = 302
force = true
conditions = { Country = ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CD", "CG", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"] }
[[redirects]]
from = "/"
to = "/"
status = 200
# Redirect exactly "/v2" (no trailing slash)
[[redirects]]
from = "/v2"
to = "/v2/trade/BTC"
status = 302
# Redirect exactly "/v2/" (with trailing slash)
[[redirects]]
from = "/v2/"
to = "/v2/trade/BTC"
status = 302
# Catch-all for everything else under `/v2/` (e.g. /v2/something)
[[redirects]]
from = "/v2/*"
to = "/index.html"
status = 200
# Redirect /referrals to /v2/referrals
[[redirects]]
from = "/referrals"
to = "/v2/referrals"
status = 302
force = true
# Redirect /affiliates to /v2/affiliates
[[redirects]]
from = "/affiliates"
to = "/v2/affiliates"
status = 302
force = true
# Catch-all for everything else - redirects to testnet
[[redirects]]
from = "/*"
to = "http://ambient-finance-testnet.netlify.app/:splat" # TODO: update to http://ambient-finance.netlify.app/:splat
status = 200