1 Star 0 Fork 23

liaoge / hmmm-backend

forked from zhousg / hmmm-backend 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

node api server

调试

调试配置 launch.json

{
  // 使用 IntelliSense 了解相关属性。
  // 悬停以查看现有属性的描述。
  // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "调试",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "runtimeExecutable": "npm",
      "windows": {"runtimeExecutable": "npm.cmd"},
      "runtimeArgs": ["run", "debug"],
      "console": "integratedTerminal",
      "protocol": "auto",
      "restart": true,
      "timeout": 20000,
      "port": 9999
    }
  ]
}

NPM命令

  • 开发运行
npm i
npm run dev
open http://localhost:7001/
  • 部署运行
npm start
npm stop
  • 其它
    • Use npm run lint to check code style.
    • Use npm test to run unit test.
    • Use npm run autod to auto detect dependencies upgrade, see autod for more detail.

组件

控制器参数检查

查询字符串合并

var sql = "SELECT * FROM ?? WHERE ?? = ?";
var inserts = ['users', 'id', userId];
sql = this.app.mysql.format(sql, inserts);

sha256

npm install -S sha.js

reqBody.password = shajs('sha256').update(reqBody.password).digest('hex')

数据库

中间件

令牌检查 authorization

  • 配置文件 config/config.default.js
  config.middleware = [
    'authorization'
  ]

  config.authorization = {
    whiteList: [
      '/base/frame/login'
    ],
    tokenHeaderKey: 'Authorization',
    authorizationPre: 'VEA-ADMIN'
  }

全局错误处理 error_handler

  • 配置文件 config/config.default.js
  config.middleware = [
    'errorHandler'
  ]

  config.errorHandler = {
  }

空文件

简介

黑马面面-后台 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/lg520000/hmmm-backend.git
git@gitee.com:lg520000/hmmm-backend.git
lg520000
hmmm-backend
hmmm-backend
master

搜索帮助