倚楼听风雨 ea3f65ebde 同步数据增加机房R33完成统计 3 years ago
..
.vscode 57415ec34c 第一次提交 3 years ago
public 57415ec34c 第一次提交 3 years ago
src ea3f65ebde 同步数据增加机房R33完成统计 3 years ago
test 57415ec34c 第一次提交 3 years ago
.dockerignore 57415ec34c 第一次提交 3 years ago
.editorconfig 57415ec34c 第一次提交 3 years ago
.eslintrc.json 57415ec34c 第一次提交 3 years ago
.gitattributes 57415ec34c 第一次提交 3 years ago
.gitignore 57415ec34c 第一次提交 3 years ago
.prettierrc.js 57415ec34c 第一次提交 3 years ago
Dockerfile 57415ec34c 第一次提交 3 years ago
LICENSE 57415ec34c 第一次提交 3 years ago
README.md dfb7fc295a 10.8 3 years ago
bootstrap.js 57415ec34c 第一次提交 3 years ago
f.yml 57415ec34c 第一次提交 3 years ago
package.json bfb9dadf31 9.29 3 years ago
tsconfig.json 57415ec34c 第一次提交 3 years ago
uni.md 57415ec34c 第一次提交 3 years ago

README.md

Node 版后台基础框架基于 Egg.js

基础:egg.js

数据:typeorm

缓存:egg-redis

鉴权:egg-jwt

网络:axios

修改数据库配置,配置文件位于src/config/config.local.ts

数据库为 mysql(>=5.7版本),node 版本(>=12.x),首次启动会自动初始化并导入数据

config.orm = {
  type: 'mysql',
  host: '127.0.0.1',
  port: 3306,
  username: 'root',
  password: 'root',
  database: 'cool-admin',
  synchronize: true,
  logging: true,
};

安装依赖并运行

$ npm i
$ npm run dev
$ open http://localhost:8001/

注: npm i如果安装失败可以尝试使用cnpm,或者切换您的镜像源

部署

rm -rf node_modules rm package-lock.json npm cache clear --force npm install

npm run build

$ npm start
$ npm stop

内置指令

  • 使用 npm run lint 来做代码风格检查。
  • 使用 npm test 来执行单元测试。

个人记录

  • rm -rf node_modules
  • rm package-lock.json
  • npm cache clear --force
  • npm install

  • npm run start

  • lsof -i:8001

  • netstat -tunlp | grep 8001

  • curl 'http://127.0.0.1:8001'

  • SERVER 需要单独安装 axios

  • cd /home/cool/server

  • npm i axios

  • // npm install qiniu npm install node-xlsx --save

  • 前端

  • // yarn add spark-md5

  • // yarn add sha1-file-web

  • yarn add qiniu-js