I made the front page of the website, the vue NPM run after serve to localhost: 8080, everything is normal, when made the back-end express, directly in the original project set up a server. The js to open service listening on port 8080 or any other port, but why the server to start, but can't access the page? Figure
CodePudding user response:
Var express=the require (" express "); Var app=new express (); App. Use (express. Static ("./page ")); App. Listen (8080); The console. The log (" service has launched ")
I in the browser input 127.0.0.1:8080 can't access the page by the index. The HTML page, But I create another pure express the back-end project can access to the page/index. The HTML
CodePudding user response:
Two port conflicts, you run directly with vue serve, is also the node using the cli - service, and then transferred to the webpack dev - server enabled services, you start the server in the original project, js, remember to run serve service to stop, should be normal, or a new server. The js in other ports,