Deploy monolithic next.js app : frontend file inside express backend file

Hello !

We’re trying to deploy our next.js app (linked to a Mongo DB by an Express backend).

The structure of our files is the following :

  • project
    – backend (express)
    —frontend (next.js)

The frontend folder is inside the backend one. And the next build command is not working.

By the way, we so have two .env files (one for the backend, the other one for the frontend), two package.json (front and back), etc.

Is this possible to deploy an app this way with Netlify ? How could we do this so ?

Many thanks !

I don’t see why not. Simply setting base directory to your frontend folder should be enough to get this working.

Hi, thank you for answering ! It did’nt work but we found an other solution. Thanks !

glad to hear you found a solution that worked for you.