-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathnext.config.js
More file actions
263 lines (256 loc) · 11.2 KB
/
Copy pathnext.config.js
File metadata and controls
263 lines (256 loc) · 11.2 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
if (!URL.canParse(process.env.WORDPRESS_API_URL)) {
throw new Error(`
Please provide a valid WordPress instance URL.
Add to your environment variables WORDPRESS_API_URL.
`)
}
const { protocol, hostname, port, pathname } = new URL(
process.env.WORDPRESS_API_URL
)
const contentSecurityPolicy = `
connect-src 'self' https://px.ads.linkedin.com https://www.google-analytics.com https://analytics.google.com https://region1.google-analytics.com https://stats.g.doubleclick.net https://rp.liadm.com https://idx.liadm.com https://pagead2.googlesyndication.com https://*.clarity.ms https://news.google.com https://assets.apollo.io https://wp.keploy.io https://cdn.hashnode.com https://keploy-websites.vercel.app https://blog-website-phi-eight.vercel.app https://docbot.keploy.io https://www.youtube.com https://youtube.com https://www.youtube-nocookie.com https://*.youtube.com https://*.googlevideo.com https://googleads.g.doubleclick.net https://marketplace.visualstudio.com https://api.github.com https://pro.ip-api.com https://api.vector.co https://aplo-evnt.com https://ep1.adtrafficquality.google https://ppptg.com https://telemetry.keploy.io;
frame-src 'self' https://www.googletagmanager.com https://keploy-websites.vercel.app https://blog-website-phi-eight.vercel.app https://docbot.keploy.io https://www.youtube.com https://youtube.com https://www.youtube-nocookie.com https://*.youtube.com https://news.google.com https://googleads.g.doubleclick.net https://*.google.com https://ppptg.com;
img-src 'self' data: https://c.bing.com https://ppptg.com https://wp.keploy.io https://keploy.io https://secure.gravatar.com https://pbs.twimg.com https://*.wp.com https://*.wordpress.com *;
`
.replace(/\s{2,}/g, ' ')
.trim()
/** @type {import('next').NextConfig} */
module.exports = {
basePath: '/blog',
assetPrefix: "/blog",
// --- ADD THIS BLOCK ---
// This exposes the server-side variable to the browser
env: {
NEXT_PUBLIC_WORDPRESS_API_URL: process.env.WORDPRESS_API_URL,
},
// ----------------------
images: {
formats: ['image/avif', 'image/webp'],
minimumCacheTTL: 31536000, // 1 year — WP images rarely change at same URL
deviceSizes: [640, 750, 828, 1080, 1200],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
domains: ['secure.gravatar.com', 'wp.keploy.io', 'keploy.io', 'pbs.twimg.com'],
remotePatterns: [
{
protocol: 'https',
hostname: 'keploy.io',
port,
pathname: '/**',
},
{
protocol: 'https',
hostname: 'wp.keploy.io',
port,
pathname: '/**',
},
],
},
async headers() {
return [
{
source: '/sitemap.xml',
headers: [
{
key: 'Cache-Control',
value: 'public, s-maxage=300, stale-while-revalidate=300',
},
],
},
{
source: '/robots.txt',
headers: [
{
key: 'Cache-Control',
value: 'public, s-maxage=86400, stale-while-revalidate=86400',
},
],
},
{
source: '/(.*)',
headers: [
{
key: 'Content-Security-Policy',
value: contentSecurityPolicy,
},
],
},
]
},
async redirects() {
return [
// ──────────────────────────────────────────────────────────
// /community/:slug → /technology/:slug
// These posts belong to "technology" in WordPress but had
// stale /community/ URLs indexed or linked externally.
// ──────────────────────────────────────────────────────────
{
source: '/community/bitbucket-self-hosting-running-ebpfprivileged-programs',
destination: '/technology/bitbucket-self-hosting-running-ebpfprivileged-programs',
permanent: true,
},
{
source: '/community/building-a-cli-tool-in-go-with-cobra-and-viper',
destination: '/technology/building-a-cli-tool-in-go-with-cobra-and-viper',
permanent: true,
},
{
source: '/community/create-stunning-parallax-animations-on-your-website',
destination: '/technology/create-stunning-parallax-animations-on-your-website',
permanent: true,
},
{
source: '/community/gemini-pro-vs-openai-benchmark-ai-for-software-testing',
destination: '/technology/gemini-pro-vs-openai-benchmark-ai-for-software-testing',
permanent: true,
},
{
source: '/community/how-to-use-covdata-for-better-code-coverage-in-go',
destination: '/technology/how-to-use-covdata-for-better-code-coverage-in-go',
permanent: true,
},
{
source: '/community/integration-of-e2e-testing-in-a-cicd-pipeline',
destination: '/technology/integration-of-e2e-testing-in-a-cicd-pipeline',
permanent: true,
},
{
source: '/community/mastering-nyc-enhance-javascript-typescript-test-coverage',
destination: '/technology/mastering-nyc-enhance-javascript-typescript-test-coverage',
permanent: true,
},
{
source: '/community/migration-guide-from-restassured-to-keploy',
destination: '/technology/migration-guide-from-restassured-to-keploy',
permanent: true,
},
{
source: '/community/protocol-parsing-guide',
destination: '/technology/protocol-parsing-guide',
permanent: true,
},
{
source: '/community/revolutionising-unit-test-generation-with-llms',
destination: '/technology/revolutionising-unit-test-generation-with-llms',
permanent: true,
},
{
source: '/community/scram-authentication-overcoming-mock-testing-challenges',
destination: '/technology/scram-authentication-overcoming-mock-testing-challenges',
permanent: true,
},
{
source: '/community/secure-your-database-communications-with-ssl-in-docker-containers-learn-to-set-up-ssl-for-mongodb-and-postgresql-efficiently',
destination: '/technology/secure-your-database-communications-with-ssl-in-docker-containers-learn-to-set-up-ssl-for-mongodb-and-postgresql-efficiently',
permanent: true,
},
{
source: '/community/using-tc-bpf-program-to-redirect-dns-traffic-in-docker-containers',
destination: '/technology/using-tc-bpf-program-to-redirect-dns-traffic-in-docker-containers',
permanent: true,
},
// ──────────────────────────────────────────────────────────
// /technology/:slug → /community/:slug
// These posts belong to "community" in WordPress but had
// stale /technology/ URLs indexed or linked externally.
// ──────────────────────────────────────────────────────────
{
source: '/technology/canary-testing-a-comprehensive-guide-for-developers',
destination: '/community/canary-testing-a-comprehensive-guide-for-developers',
permanent: true,
},
{
source: '/technology/codium-vs-copilot-which-ai-coding-assistant-is-best-for-you',
destination: '/community/codium-vs-copilot-which-ai-coding-assistant-is-best-for-you',
permanent: true,
},
{
source: '/technology/decoding-brd-a-devs-guide-to-functional-and-non-functional-requirements-in-testing',
destination: '/community/decoding-brd-a-devs-guide-to-functional-and-non-functional-requirements-in-testing',
permanent: true,
},
{
source: '/technology/decoding-http2-traffic-is-hard-but-ebpf-can-help',
destination: '/community/decoding-http2-traffic-is-hard-but-ebpf-can-help',
permanent: true,
},
{
source: '/technology/how-to-generate-test-cases-with-automation-tools',
destination: '/community/how-to-generate-test-cases-with-automation-tools',
permanent: true,
},
{
source: '/technology/mock-vs-stub-vs-fake-understand-the-difference',
destination: '/community/mock-vs-stub-vs-fake-understand-the-difference',
permanent: true,
},
{
source: '/technology/performance-testing-guide-to-ensure-your-software-performs-at-its-best',
destination: '/community/performance-testing-guide-to-ensure-your-software-performs-at-its-best',
permanent: true,
},
{
source: '/technology/python-get-current-directory',
destination: '/community/python-get-current-directory',
permanent: true,
},
{
source: '/technology/top-5-cypress-alternatives-for-web-testing-and-automation',
destination: '/community/top-5-cypress-alternatives-for-web-testing-and-automation',
permanent: true,
},
{
source: '/technology/understanding-branch-coverage-in-software-testing',
destination: '/community/understanding-branch-coverage-in-software-testing',
permanent: true,
},
{
source: '/technology/understanding-statement-coverage-in-software-testing',
destination: '/community/understanding-statement-coverage-in-software-testing',
permanent: true,
},
{
source: '/technology/what-is-postgres-wire-protocol',
destination: '/community/what-is-postgres-wire-protocol',
permanent: true,
},
{
source: '/technology/writing-test-cases-for-cron-jobs-testing',
destination: '/community/writing-test-cases-for-cron-jobs-testing',
permanent: true,
},
// ──────────────────────────────────────────────────────────
// Broken backlink redirects
// ──────────────────────────────────────────────────────────
{
source: '/community/end-to-end-testing-and-why-do-you-need-it',
destination: '/community/end-to-end-testing-guide',
permanent: true,
},
{
source: '/community/rest-api-testing-guide',
destination: '/community/api-testing-strategies',
permanent: true,
},
{
source: '/community/https-keploy-io-blog-community-cursor-vs-github-copilot',
destination: '/community/codium-vs-copilot-which-ai-coding-assistant-is-best-for-you',
permanent: true,
},
{
source: '/community/software-development-tools-in-2025',
destination: '/community/software-development-tools',
permanent: true,
},
{
source: '/community/guide-to-automated-testing-tools-in-2025',
destination: '/community/automated-software-testing-tools',
permanent: true,
},
{
source: '/community/top-7-test-automation-tools-boost-your-software-testing-efficiency',
destination: '/community/test-automation-tools',
permanent: true,
},
]
},
}