GithubHelp home page GithubHelp logo

steve000 / bbs_node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 2017coding/bbs_node

0.0 2.0 0.0 787 KB

node后端服务,node+express+mysql, 搭建token-权限-管理完整的web服务, 对应页面: https://www.lyh.red/admin \ https://www.lyh.red/bbs \ 接口地址https://www.lyh.red/apidoc/index.html

JavaScript 40.33% PLpgSQL 55.54% TSQL 4.13%

bbs_node's Introduction

Build Setup

# 安装依赖
npm install

# 运行项目
npm run dev

# 运行node服务
npm run dev

# 使用热更新打开node服务,方便边开发边调试 (调试时用Debug)
npm run hot

# 更新接口后使用此命令重新生成api相关文档
npm run apidoc

# 使用forever 实现在服务器上关闭控制台时node服务正常访问
npm run start # 启用node服务
npm run stop  # 关闭node服务

# 项目基本结构
├── config                     // 配置相关
├── controller                 // 控制器
├── model                      // model
├── mysql                      // mysql配置文件
├── node_modules               // 项目依赖
├── public                     // 静态资源库
├── routes                     // 路由
├── .babelrc                   // babel-loader 配置
├── eslintrc.js                // eslint 配置项
├── .gitignore                 // git 忽略项
├── app.js                     // 入口 加载配置 初始化
├── index.js                   // 启动文件
└── package.json               // package.json

返回的数据格式

 {
   success: true,        // 响应状态
   code: 20000,         // 状态码
   content: {},        // 数据
   message: '操作成功' // 提示
 }

返回码和相关提示定义

1 为账号错误 2 为认证错误 3 为参数错误 4 为数据不存在 5 为系统错误 0 为成功

状态码 定义
20101 当前被登出
20201 身份认证失败
20202 无操作权限
20203 用户未绑定角色
20301 参数错误
20401 数据不存在
20501 服务器内部错误
20000 操作成功
20001 操作失败

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.