-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnext.config.js
34 lines (31 loc) · 855 Bytes
/
next.config.js
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
/** @type {import('next').NextConfig} */
const nextConfig = {
rewrites: async () => {
const rewrites = {
afterFiles: [
// apply any of your existing rewrites here
],
fallback: []
}
// dev only, this allows for local api calls to be proxied to
// api routes that use rust runtime
if (process.env.NODE_ENV === 'development') {
rewrites.fallback.push({
source: '/api/:path*',
destination: 'http://0.0.0.0:3001/api/:path*'
})
}
return rewrites
},
redirects: async () => {
return [
{
source: '/',
// read my article for more info about this template
destination: 'https://medium.com/@capJavert/integrating-rust-into-next-js-how-to-developer-guide-10e533470d71',
permanent: false
}
]
}
}
module.exports = nextConfig