Skip to content

Commit

Permalink
[docs] Fix failing client-side navigation for /api routes
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Sep 15, 2021
1 parent 2ed550d commit 33b1bc9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ module.exports = {
},
};
},
trailingSlash: true,
env: {
COMMIT_REF: process.env.COMMIT_REF,
ENABLE_AD: process.env.ENABLE_AD,
Expand Down Expand Up @@ -223,8 +222,13 @@ module.exports = {
return map;
},
reactStrictMode,
trailingSlash: true,
async rewrites() {
return [{ source: `/:lang(${LANGUAGES.join('|')})?/:rest*`, destination: '/:rest*' }];
return [
{ source: `/:lang(${LANGUAGES.join('|')})?/:rest*`, destination: '/:rest*' },
// Make sure to include the trailing slash if `trailingSlash` option is set
{ source: '/api/:rest*/', destination: '/api-docs/:rest*/' },
];
},
// Can be turned on when https://github.com/vercel/next.js/issues/24640 is fixed
optimizeFonts: false,
Expand Down

0 comments on commit 33b1bc9

Please sign in to comment.