because there is an official react-dev-server, I use express to write a node server feel there is a conflict? How to solve it
because there is an official react-dev-server, I use express to write a node server feel there is a conflict? How to solve it
just write in express, except that there are two services running during development, one front-end service and one back-end service, and the front end requests back-end services across domains
the project I am in charge of now is the transfer background
written by koa2 in the foreground of react created by create-react-app. There is no conflict in the development
react access node transit route, node processing http request return data
does not affect each other, the front end writes the front end code koa2 writes the corresponding service
, which is different from directly accessing the xxxx.service is to visit the corresponding service of node first and then node to adjust the corresponding interface
//koa
const param = {
url: 'login',
params: { },
dispatch, getState, fail: loginFail
}
const { data: { config, list } } = await get(param);
// Login http
router.get('login', async (ctx, next) => {
const xx= new Login('Login');
await xx.login(ctx, next);
})
I can run before packaging without any error reports. This problem occurs after packaging. reports such an error in the browser, using scaffolding made by create-react-app, and the back end is Node.js, backend. No error is reported: packages two diff...
like this [array [xxx], array [xxx], array [xxx].] merge all xxx in array into one array [xxx.] ...
how does react ant use custom form validation? 1. Code const Login = ( { loading, dispatch, form: { getFieldDecorator, validateFieldsAndScroll }, } ) => { function handleOk() { validateFieldsAndScroll((error...
simply write a project with ant-design-pro, and write a server.js and npm run build packaged file in the root directory with the built-in mock API,. The dist directory is as follows: server.js: server.js302Cannot read property notifyCount of unde...
recently encountered a demand, the react project needs to add a rich text editor, there are many online, to find a braft-editor, their own new project to use no problem. However, when adding to the project, because the project uses server rendering (jus...
take websites made of Vue as an example. Baimi Wallet https: www.bmqb.com a safety( website comes from the sponsor of the official Vue.js website) brief Nuggets. I don t know why. I always feel that these vue sites can be seen at a glance that...
package.json { "name ": "demo ", "version ": "0.1.0 ", "homepage ": ". ", "private ": true, "dependencies ": { "antd": "^3.0.1", "autoprefixer": "7.1.1", "axios": "^0.16.2", "...
set an interface in node and call it with react. The status code always shows that the status code is 304 react: . componentWillReceiveProps(nextProps){ let that=this; let tab=nextProps.tab|| attention ; let sort=nextProps.sort|| like ...
this occurs as soon as the background of node is opened and the front end is refreshed. node: in this case, it is OK to turn off node before refreshing. The agent has successfully obtained the data. I opened the front end first, and then the nod...
The react project is packaged in webpack, and you can directly use the path module in require node. but require ( fs ) will report an error: looked it up on the Internet and added this configuration to webpack.config: node:{ fs: empty ...
an expandable and shrinking react component. Inside the component, there is a button to switch between shrinking and expanding, and pull down, pull up and expand in the internal support of the component, and throw onChange events when changing . how to...
Why doesn t react automatically generate key, for lists instead of developers writing their own key? The uniqueness of react generated by itself can be guaranteed, is it because the stability of key cannot be guaranteed? ...
as shown in the figure, using proxy to solve cross-domain, I see many blogs say that this can solve cross-domain. What is the reason for this? A blog said that it was written in this way, and tried to report an error saying that proxy should not be ...
whether the fields in the data structure returned by the backend have no information need to return this key? for example, there is a list, in the list result. If the list is empty, does the backend not return the list field? how is it reasonable? ...
as detailed in the title: develop react project, use git bash to set up the server, but when the page changes the code and makes a mistake, the server always crashes and has to be restarted. I remember that it didn t seem to be so fragile before, h...
problem description I use npm i antd-- save to download antd Times error, there is a three-point error the environmental background of the problems and what methods you have tried related codes Please paste the code text below (do not replac...
< H1 > dva-cli create project npm start prompt "Cannot find module .. lib server " to solve. < H1 > it is not possible to reinstall the node package, and there are some in roadhog the following is the picture: ...
...
error message is shown in the following figure ...
as shown in figure do you have ready-made wheels? ...