-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathnext.config.js
More file actions
28 lines (27 loc) · 767 Bytes
/
next.config.js
File metadata and controls
28 lines (27 loc) · 767 Bytes
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
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = {
images: {
domains: ['firebasestorage.googleapis.com'],
},
async rewrites() {
return [
{
source: '/api/:path*',
destination: 'https://kulkunda-backend.onrender.com/api/:path*', // Replace with your backend server's address
},
];
},
async serverMiddleware() {
// Create a proxy for '/api' requests
this.nuxt.hook('render:setupMiddleware', (app) => {
app.use(
'/api',
createProxyMiddleware({
target: 'https://kulkunda-backend.onrender.com', // Replace with your backend server's address
changeOrigin: true,
pathRewrite: { '^/api': '' },
})
);
});
},
};