In actual development, sometimes we need to simulate the server file system, so we need to use the server file system related functions.
There are several more convenient tools, such as the combination of Node and express, anywhere, http-server.
anywhere
Use npm install anywhere -g to install globally, of course, cnpm can also be used. Execute anywhere in the directory corresponding to the local file you want to publish.
Other commands:
- anywhere -p 8000 ## Specify the port number of the static server
- anywhere -s ## execute silently without opening the browser
http-client
Also use node to installnpm
install
-g http-server。
start, http-server -a 127.0.0.1 -p 7070
You can also configure package.json
"scripts"
: {
"start"
:
"http-server -a 127.0.0.1 -p 7070"
}
1. Service startup: ng serve (-o, --open)
2. Create service: ng generate service XXX (--module=app)
3. (routing) create: ng generate module app-routing --flat --module =app
4. Create component: ng generate component XXX