-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathnetlify.toml
More file actions
56 lines (47 loc) · 1.62 KB
/
netlify.toml
File metadata and controls
56 lines (47 loc) · 1.62 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
# Netlify Configuration for CD Practices App
[build]
command = "npm run build"
publish = "build"
[build.environment]
NODE_VERSION = "24.8.0"
# Database migrations run automatically via npm run build
# which calls db:migrate:node (Node.js script using pg package)
# Security headers
[[headers]]
for = "/*"
[headers.values]
Permissions-Policy = "geolocation=(), microphone=(), camera=()"
Referrer-Policy = "strict-origin-when-cross-origin"
X-Content-Type-Options = "nosniff"
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
# Cache static assets
[[headers]]
for = "/_app/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Cache API responses (5 minutes)
[[headers]]
for = "/api/*"
[headers.values]
Cache-Control = "public, max-age=300, s-maxage=600, stale-while-revalidate=300"
# Postgres addon configuration
[functions]
external_node_modules = [
"pg"
]
node_bundler = "esbuild"
# Environment-specific settings
# Production uses DATABASE_URL from Netlify environment variables
# Deploy Previews (Pull Request previews)
[context.deploy-preview]
[context.deploy-preview.environment]
NODE_ENV = "development"
# DATABASE_URL = "set this in Netlify UI for deploy-preview context"
# Or use DEPLOY_PREVIEW_DATABASE_URL from environment variables
# Branch Deploys (non-production branches)
[context.branch-deploy]
[context.branch-deploy.environment]
NODE_ENV = "development"
# DATABASE_URL = "set this in Netlify UI for branch-deploy context"
# Or use BRANCH_DEPLOY_DATABASE_URL from environment variables