thank you for your helping!
this is amplify.yml.
amplify mock api and npm run ci commands work on local env.
version: 1
backend:
phases:
preBuild:
commands:
- amazon-linux-extras enable corretto8
- yum install -y java-1.8.0-amazon-corretto java-1.8.0-amazon-corretto-devel
- npm ci
- npm run ci # this script calls `amplify mock api`.
build:
commands:
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
a part of package.json
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"test:ci": "CI=true npm run test",
"eject": "react-scripts eject",
"start-server": "amplify mock api",
"ci": "start-server-and-test start-server http://localhost:20002 test:ci"
},