我在1和1.com上有一个域,我在徘徊如何将前端和后端部署到该域,我可以使前端向上,但是没有后端可以帮助我,我有两个package.json文件..第一个用于后端...
{
"name": "bgtracker",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
"author": "Wesley Owen",
"license": "MIT",
"dependencies": {
"bcryptjs": "^2.4.3",
"concurrently": "^5.2.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"mysql": "^2.18.1"
},
"devDependencies": {
"dotenv": "^8.2.0",
"nodemon": "2.0.4"
}
} 前端是....
{
"name": "client",
"homepage": "http://mydiabetesdatadoctors.com",
"version": "1.0.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.9.14",
"@material-ui/icons": "^4.9.1",
"chart.js": "^2.9.3",
"react": "^16.13.1",
"react-async-script-loader": "^0.3.0",
"react-chartjs-2": "^2.9.0",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "Set PORT=8080 && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://localhost:4000"
}