1. Install the koa – the generator

$ npm install -g koa-generator
Copy the code

2. Use KOA-Generator to generate koA2 projects

$ koa2  -eProject name (project name)-eStands for using template engine EJS.)Copy the code

3. Enter the project

$ cd project 
$ npm install
Copy the code

4. Start the project. The default port number is 3000

$DEBUG=koa2-learn:* NPM start (this method needs to restart the service when modifying the file. Not recommended) $NPM run dev (this method can refresh the service directly)Copy the code

5. Project Catalog

Refer to the link: www.cnblogs.com/cckui/p/995…