Use serve to build a local server, the steps are as follows:
- Install serve globally:
npm install -g serve
. - Start the local server:
serve 目标文件夹
.serve target-folder
。serve target-folder -p 3030
.-p
, specifying the port.serve target-folder -C
.-C
Alternatively--core
, cross-domain.
Related Links
The simple use of the NPM package serve, when the web server
node environment uses serve to publish the folder as a static service, and solve the service cross-domain problem