I'm having a problem deploying to Amplify. Before that, I deployed to heroku, and there were no problems. I have a react application that uses express on the backend.
For Heroku, the following algorithm works. I install the dependencies for the server npm install , then go to the client folder and install the dependencies for the frontend npm install. Then the frontend of application is built npm run build.
At the root of my application, I have a procfile where it says web: npm start. After deploying this scenario, the server starts up in production mode and gives me the builded index.html from the client/build folder. Things are good.
OK. For deploying to Amplify, I try to use this amplify.yml
version: 1
env:
variables:
PROD: true
backend:
phases:
preBuild:
commands:
- npm install
build:
commands: []
frontend:
phases:
preBuild:
commands:
- cd client
- npm install
build:
commands:
- npm run build
artifacts:
baseDirectory: client/build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
The build is going well, and I can go to the link and see my application. But only the frontend was deployed. Requests to my server are not working