nodejs + koa-generator 创建后端项目

E:\backend-workspace>npm install koa-generator -g

npm warn deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

added 5 packages in 2s

E:\backend-workspace>koa2 emall-backend2 -e --ejs

create : emall-backend2

create : emall-backend2/package.json

create : emall-backend2/app.js

create : emall-backend2/public

create : emall-backend2/routes

create : emall-backend2/routes/index.js

create : emall-backend2/routes/users.js

create : emall-backend2/views

create : emall-backend2/views/index.ejs

create : emall-backend2/views/error.ejs

create : emall-backend2/bin

create : emall-backend2/bin/www

create : emall-backend2/public/stylesheets

create : emall-backend2/public/stylesheets/style.css

install dependencies:

> cd emall-backend2 && npm install

run the app:

> SET DEBUG=koa* & npm start emall-backend2

create : emall-backend2/public/javascripts

create : emall-backend2/public/images

E:\backend-workspace>cd emall-backend2 && npm install

npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated

npm warn deprecated consolidate@0.15.1: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog

npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated

npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

npm warn deprecated keygrip@1.1.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

npm warn deprecated koa-router@7.4.0: Please use @koa/router instead, starting from v9!

npm warn deprecated koa-views@6.3.1: This package is deprecated, please use the new fork @ladjs/koa-views. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/koa-views for updates and release changelog

npm warn deprecated ejs@2.3.4: Critical security bugs fixed in 2.5.5

added 389 packages in 9s

34 packages are looking for funding

run `npm fund` for details

E:\backend-workspace\emall-backend2> SET DEBUG=koa* & npm start emall-backend2

> emall-backend2@0.1.0 start

> node bin/www emall-backend2

koa-router defined route [ 'HEAD', 'GET' ] / +0ms

koa-router defined route [ 'HEAD', 'GET' ] /string +1ms

koa-router defined route [ 'HEAD', 'GET' ] /json +1ms

koa-router defined route [ 'HEAD', 'GET' ] /users/ +1ms

koa-router defined route [ 'HEAD', 'GET' ] /users/bar +0ms

koa:application use bodyParser +0ms

koa:application use filter +1ms

koa:application use logger +0ms

koa-static static "E:\backend-workspace\emall-backend2/public" {} +0ms

koa:application use serve +7ms

koa:application use views +0ms

koa:application use - +0ms

koa:application use dispatch +0ms

koa:application use dispatch +1ms

Port 3000 is already in use

E:\backend-workspace\emall-backend2> SET DEBUG=koa* & npm start emall-backend2

> emall-backend2@0.1.0 start

> node bin/www emall-backend2

koa-router defined route [ 'HEAD', 'GET' ] / +0ms

koa-router defined route [ 'HEAD', 'GET' ] /string +1ms

koa-router defined route [ 'HEAD', 'GET' ] /json +0ms

koa-router defined route [ 'HEAD', 'GET' ] /users/ +1ms

koa-router defined route [ 'HEAD', 'GET' ] /users/bar +1ms

koa:application use bodyParser +0ms

koa:application use filter +0ms

koa:application use logger +0ms

koa-static static "E:\backend-workspace\emall-backend2/public" {} +0ms

koa:application use serve +7ms

koa:application use views +0ms

koa:application use - +1ms

koa:application use dispatch +0ms

koa:application use dispatch +0ms

<-- GET /

koa-send send "/" {"root":"E:\\backend-workspace\\emall-backend2\\public","index":"index.html"} +0ms

koa-router GET / +0ms

koa-router test / /^(?:\/(?=))?/i { keys: [] } +1ms

koa-router test /string /^\/string(?:\/(?=))?/i { keys: [] } +0ms

koa-router test /json /^\/json(?:\/(?=))?/i { keys: [] } +0ms

koa-views render `index.ejs` with {"title":"Hello Koa 2!","partials":{}} +0ms

GET / - 13ms

--> GET / 200 27ms 226b

<-- GET /stylesheets/style.css

koa-send send "/stylesheets/style.css" {"root":"E:\\backend-workspace\\emall-backend2\\public","index":"index.html"} +65ms

--> GET /stylesheets/style.css 200 9ms 111b

<-- GET /favicon.ico

koa-send send "/favicon.ico" {"root":"E:\\backend-workspace\\emall-backend2\\public","index":"index.html"} +62ms

koa-router GET /favicon.ico +123ms

koa-router test / /^(?:\/(?=))?/i { keys: [] } +0ms

koa-router test /string /^\/string(?:\/(?=))?/i { keys: [] } +0ms

koa-router test /json /^\/json(?:\/(?=))?/i { keys: [] } +1ms

koa-router GET /favicon.ico +0ms

koa-router test /users/ /^\/users(?:\/(?=))?/i { keys: [] } +0ms

koa-router test /users/bar /^\/users\/bar(?:\/(?=))?/i { keys: [] } +0ms

GET /favicon.ico - 1ms

--> GET /favicon.ico 404 3ms -

相关推荐
用户47949283569154 小时前
都说node.js是事件驱动的,什么是事件驱动?
前端·node.js
Juchecar6 小时前
Spring是Java语境下的“最优解”的原因与启示
java·spring·node.js
月下点灯10 小时前
🏮一眼就会🗂️大文件分片上传,白送前后端全套功法
javascript·typescript·node.js
一雨方知深秋16 小时前
2.fs模块对计算机硬盘进行读写操作(Promise进行封装)
javascript·node.js·promise·v8·cpython
小彭律师21 小时前
Node.js环境变量配置的实战技术
node.js
Q_Q5110082851 天前
python+django/flask的校园活动中心场地预约系统
spring boot·python·django·flask·node.js·php
Q_Q19632884751 天前
python+django/flask基于机器学习的就业岗位推荐系统
spring boot·python·django·flask·node.js·php
by__csdn1 天前
Node.js版本与npm版本的对应关系
前端·npm·node.js
aini_lovee1 天前
Node.js 中的中间件机制与 Express 应用
中间件·node.js·express