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 -

相关推荐
king13598745503 小时前
AI Agent 端云协同选型:Node.js 任务成本算例与权限检查清单(2027—2028 展望)
人工智能·ai·node.js·ai agent
居里先生7526 小时前
PDF 批注到底存在文件的哪里?从 /Annots 讲到导出验证
node.js
MasonYyp1 天前
安装npm依赖仓库Verdaccio
前端·npm·node.js
编程的一拳超人2 天前
【元宝搜索开发者征文大赛】四语实战:Java/Python/Go/Node.js 构建 AI 搜索应用全攻略
java·python·golang·node.js·agent
lucas_AI2 天前
今年 2 月就修好的漏洞,10 月才炸:HTTP2Shell 把 Node、Python 一锅端
node.js
SEO_juper3 天前
Node.js 全站死链检测工具:从 sitemap 出发一次找全 404
开发语言·人工智能·python·node.js·seo·外贸独立站
孟陬4 天前
解决动态 import 类型 Any 痼癖
typescript·node.js·bun
Dumbness4 天前
后台管理员把自己锁在门外:RBAC 里「自己的权限只能由别人来减」
安全·node.js
攻城狮白玉4 天前
Node.js 发布紧急安全更新:10 个漏洞,8 枚危险证书被拉黑。附AI修复提示词
node.js
Json____5 天前
用 FastAPI + Vue3 打造一套完整的在线考试系统:从组卷到阅卷的业务闭环实践
后端·node.js·fastapi·it学习·wwwoop.com