1.0.20 • Published 1 year ago

track-proxy-hxm v1.0.20

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Dispatch center

调度中心

项目说明

  • 项目目录结构
+-build                       # 打包构建配置
+-config                      # 项目配置
+-dist                        # 构建打包目录
+-lib                         # 后端代码
| +-config                    # 后端配置
| +-common                    # 后端公共代码
| | +-config                  # 公共模块配置
| | +-services                # 公共服务
| | +-utils                   # 公共工具方法
| +-api-v1                    # HTTP 接口控制器,主要逻辑
| +-utils                     # 工具集合
| +-routes.js                 # 后端路由
+-logs                        # 日志
+-node_modules                # node 模块
+-test                        # 单元测试
| +-api-v1                    # 接口测试定义
|
+-gulpfile.js                 # gulp 入口
+-package.json                # 后端依赖库描述文件
+-server.js                   # 服务启动入口

node_modules 目录下的包要通过 npm install 安装

环境依赖

使用方法

根据 package.json 下载相应包

cd 到项目目录
npm install

运行开发服务

npm start

含前端的项目将用浏览器打开 http://[服务器ip]:[服务监听端口 + 1000]

运行开发服务调试模式

执行

npm run debug

用 Chromium-based 浏览器打开 chrome://inspect,点击 Configure,输入 [服务器ip]:[服务监听端口 + 2000],点击 Done 保存,即可选择要调试的服务

接口单元测试

npm test [接口测试用例]

npm test api-v1/user/manage

提交版本与构建

  1. 修改 package.json 中的版本号

  2. 生成 CHANGELOG.md

    npm run changelog
  3. 提交并创建 tag

    git commit -m "v[版本号]"
    git push
    git tag v[版本号]
    git push --tag
  4. 构建发行包

    npm run build

    项目目录下的 dist/dispatch-center-[版本号].tar.gz 为发行包

部署到 CentOS 说明

CentOS 版本:CentOS 7.x

安装 gcc, g++, openssl, python(要求2.6或2.7版本):

yum install gcc gcc-c++ openssl-devel

安装 Node.js

wget https://npm.taobao.org/mirrors/node/latest/node-v8.11.1-linux-x64.tar.gz
tar -xzvf node-v8.11.1-linux-x64.tar.gz
mv node-v8.11.1-linux-x64 /dispatch-center/node

修改 /etc/profile, 修改以下内容

# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
else
    pathmunge /usr/local/sbin after
    pathmunge /usr/sbin after
fi

# 增加下面这行
pathmunge /dispatch-center/node/bin

执行

source /etc/profile

安装 pm2

 npm install pm2@latest -g

注意:详细使用可参考 pm2 官网

内容为

部署平台发行包

复制发行包 dispatch-center-[版本号].tar.gz 到操作系统

tar zxvf dispatch-center.tar.gz -d dispatch-center

访问路径 http(s)://[服务器ip]:[服务监听端口]

1.0.20

1 year ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.11

3 years ago

1.0.15

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago