0

I'm having that problem where I'm trying to deploy Express and React boilerplate app like one app on Azure App Services. Locally everything works normaly, but when I try to deploy the whole thing, I see ":( Application Error " screen. I think it has to do something with the way my "scripts" inside server's package.json are set...(deploying only express server without client files works just fine). Here I'm trying to let Azure execute the build command once the app is deployed and not before that:

"scripts": { "start": "cd client && npm run build && cd ../ && node server", "test": "echo something" },

Probably I'm missing something crucial for Azure (I'm a beginner).I've read a lot and followed many tutorials but nothing seems to solve my problem. I'll really appreciate it if someone can give me a hand. Thank you!

Link to my github repo : https://github.com/Ivailo663/finalExpressApp

1 Answer 1

0
"scripts": { "start": "cd client && npm run build && cd ../ && node server", "test": "echo something" }

This script will work if you already have all the modules your app needed, but if you don't have the modules, you need to install them first.

However, it is recommended that you build the client locally or use pipline to deploy the build folder to azure.

6
  • Can you give me some guidance of how to do that? I also read somewhere something about web.config file... getting even more confused now. @Tony Ju Commented Apr 30, 2020 at 10:34
  • @IvailoGeorgiev My suggestions is that you build the client locally. I don't think Azure will run npm install under client folder automatically.
    – Tony Ju
    Commented May 1, 2020 at 8:25
  • Does that mean that the build folder should be uploaded into github? @Tony Ju Commented May 1, 2020 at 12:38
  • @IvailoGeorgiev Yes, I think so.
    – Tony Ju
    Commented May 1, 2020 at 12:40
  • @IvailoGeorgiev If we need to deploy an angular app, we just put the files in build folder to wwwroot directory.
    – Tony Ju
    Commented May 1, 2020 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.