-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from btb-finance/docs/update-readme
chore: add Netlify configuration
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[build] | ||
command = "npm run build" | ||
publish = ".next" | ||
|
||
[build.environment] | ||
NEXT_PUBLIC_SITE_URL = "https://btb.finance" | ||
NODE_VERSION = "18" | ||
NPM_VERSION = "9" | ||
|
||
[[plugins]] | ||
package = "@netlify/plugin-nextjs" | ||
|
||
# Handle SPA routing | ||
[[redirects]] | ||
from = "/*" | ||
to = "/index.html" | ||
status = 200 | ||
|
||
# Force HTTPS | ||
[[redirects]] | ||
from = "http://*" | ||
to = "https://:splat" | ||
status = 301 | ||
force = true | ||
|
||
# Handle Next.js Image Optimization | ||
[[redirects]] | ||
from = "/_next/image*" | ||
to = "/_next/image/:splat" | ||
status = 200 | ||
|
||
# Add security headers | ||
[[headers]] | ||
for = "/*" | ||
[headers.values] | ||
X-Frame-Options = "DENY" | ||
X-XSS-Protection = "1; mode=block" | ||
X-Content-Type-Options = "nosniff" | ||
Referrer-Policy = "strict-origin-when-cross-origin" | ||
Content-Security-Policy = "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Redirect all routes to index.html for SPA routing | ||
/* /index.html 200 | ||
|
||
# Handle API routes | ||
/api/* /.netlify/functions/:splat 200 |