我想使用Cpanel使我的网站在线。
但是成功上传它并可以访问网站后,我收到了一个无限请求XHR Sockjs节点。
Websocket'失败:WebSocket握手期间出错:意外 响应码:400
预览
如您所见,我在这里提出了要求:
sockjs-node / 901 / xxyjg0gp / xhr?t = 1550550901496
这只是几次:
sockjs-node / 901 / 0njhvqec / eventsource
我创建的网站是React-(Create-React-App)/ SPA /客户端渲染。
我的package.json:
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.12",
"@fortawesome/free-brands-svg-icons": "^5.6.3",
"@fortawesome/free-solid-svg-icons": "^5.6.3",
"@fortawesome/react-fontawesome": "^0.1.3",
"@material-ui/core": "^3.7.1",
"@material-ui/icons": "^3.0.1",
"axios": "^0.18.0",
"forever": "^0.15.3",
"history": "^4.7.2",
"js-cookie": "^2.2.0",
"jsonwebtoken": "^8.4.0",
"jwt-decode": "^2.2.0",
"moment": "^2.23.0",
"prop-types": "^15.6.2",
"querystring": "^0.2.0",
"react": "^16.7.0",
"react-addons-update": "^15.6.2",
"react-cookie": "^3.0.8",
"react-dom": "^16.7.0",
"react-image-gallery": "^0.8.12",
"react-images": "^0.5.19",
"react-redux": "^6.0.0",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.2",
"react-select": "^2.3.0",
"react-slick": "^0.23.2",
"redux": "^4.0.1",
"redux-devtools-extension": "^2.13.7",
"redux-thunk": "^2.3.0",
"slick-carousel": "^1.8.1",
"typeface-roboto": "0.0.54"
},
"proxy": "http://localhost:50000",
"scripts": {
"start": "PORT=40000 react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
我需要使用端口40000来通过端口80运行React.js,并且我已经使用Express.js进行后端操作,但是我不运行后端只是做出反应而仍然得到了它。