DEV Community

Mateja Petrovic
Mateja Petrovic

Posted on

Deployment of Next.js Flask app

Hello,

For the first time I am trying to deploy nextjs app with flask as backend.

I used flask in my pages/api directory.

If I run "npm run build" It will just be running "info Creating an optimized production build" for a while and nothing happens.

The script code in pacakge.json:
"scripts": {
"flask-dev": "python -m flask --app pages/api/index run -p 8080 --reload",
"next-dev": "next dev",
"dev": "concurrently \"pnpm run next-dev\" \"pnpm run flask-dev\"",
"build": "next build"
},

I am not sure if python will be running if I just build next js app, but since I havent deployed any app like this I appreciate any anwer and help.

My question is:
Will python be running on my hosted web site if I just persist and wait for the npm build to be finished?

Top comments (0)