Next.js Discord

Discord Forum

NextJS build with flask port

Unanswered
Masai Lion posted this in #help-forum
Open in Discord
Avatar
Masai LionOP
I was using the NextJS flask starter and it had this code in the config.
/** @type {import('next').NextConfig} */
const nextConfig = {
    rewrites: async () => {
        return [
            {
                source: '/api/:path*',
                destination:
                    process.env.NODE_ENV === 'development'
                        ? 'http://127.0.0.1:5328/api/:path*'
                        : '/api/',

            },
        ]
    },
}

module.exports = nextConfig

this works on next dev but not when i do next build and next start. how can make it work on production?

2 Replies

Avatar
Masai LionOP
nvm i goti t
Avatar
European pilchard
How’d u fix