Skip to content

Commit

Permalink
Merge pull request #37 from btb-finance/docs/update-readme
Browse files Browse the repository at this point in the history
chore: add Netlify configuration
  • Loading branch information
iownducks authored Dec 11, 2024
2 parents 6515ffc + d2dbfd2 commit 58eab42
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
40 changes: 40 additions & 0 deletions netlify.toml
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';"
5 changes: 5 additions & 0 deletions public/_redirects
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

0 comments on commit 58eab42

Please sign in to comment.