add trailing slash config to fix i18n with api routes

This commit is contained in:
myl7 2022-02-06 17:26:46 +08:00
parent 85b51fe5c1
commit aa848c92f8
No known key found for this signature in database
GPG key ID: 04F1013B67177C88

View file

@ -2,5 +2,7 @@ const { i18n } = require('./next-i18next.config')
module.exports = {
i18n,
reactStrictMode: true
reactStrictMode: true,
// Required by Next i18n with API routes, otherwise API routes 404 when fetching without trailing slash
trailingSlash: true
}