# track-proxy-hxm

> track proxy module

Latest version **1.0.20** (published 2023-02-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install track-proxy-hxm
pnpm add track-proxy-hxm
yarn add track-proxy-hxm
bun add track-proxy-hxm
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.20 |
| Published | 2023-02-24 |
| First published | 2021-04-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 658.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | hxm |
| Maintainers | huangxingming |

## Links

- npm: https://www.npmjs.com/package/track-proxy-hxm
- npm.io page: https://npm.io/package/track-proxy-hxm

## Dependencies (11)

- [ws](https://npm.io/package/ws.md) ^5.2.2
- [pino](https://npm.io/package/pino.md) ^6.11.2
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [hashring](https://npm.io/package/hashring.md) ^3.2.0
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.0.0
- [bufferutil](https://npm.io/package/bufferutil.md) ^4.0.3
- [superagent](https://npm.io/package/superagent.md) ^6.1.0
- [pino-pretty](https://npm.io/package/pino-pretty.md) ^4.7.1
- [utf-8-validate](https://npm.io/package/utf-8-validate.md) ^5.0.4

## Recent versions

- 1.0.20 (latest) — 2023-02-24
- 1.0.18 — 2021-09-08
- 1.0.17 — 2021-09-08
- 1.0.16 — 2021-08-04
- 1.0.15 — 2021-08-04
- 1.0.13 — 2021-08-04
- 1.0.12 — 2021-08-04
- 1.0.11 — 2021-08-03
- 1.0.10 — 2021-05-28
- 1.0.9 — 2021-05-11
- 1.0.8 — 2021-04-24
- 1.0.7 — 2021-04-23
- 1.0.6 — 2021-04-21
- 1.0.5 — 2021-04-21
- 1.0.3 — 2021-04-20
- … 3 more at https://npm.io/package/track-proxy-hxm/versions

## README

# Dispatch center

调度中心

## 项目说明

* 项目目录结构

```sh
+-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` 安装**

## 环境依赖

* [Node.js](http://nodejs.org/) - [下载](http://nodejs.org/download)
* 数据库 [MongoDB](https://www.mongodb.com/) - [下载和安装](https://www.mongodb.com/download-center)

## 使用方法

### 根据 `package.json` 下载相应包

```sh
cd 到项目目录
npm install
```

### 运行开发服务

```sh
npm start
```

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

### 运行开发服务调试模式

执行

```sh
npm run debug
```

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

### 接口单元测试

```sh
npm test [接口测试用例]
```

如

```sh
npm test api-v1/user/manage
```

### 提交版本与构建

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

2. 生成 `CHANGELOG.md`

   ```sh
   npm run changelog
   ```

3. 提交并创建 tag

   ```sh
   git commit -m "v[版本号]"
   git push
   git tag v[版本号]
   git push --tag
   ```

4. 构建发行包

   ```sh
   npm run build
   ```

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

### 部署到 CentOS 说明

CentOS 版本：CentOS 7.x

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

```sh
yum install gcc gcc-c++ openssl-devel
```

#### 安装 Node.js

```sh
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`， 修改以下内容

```sh
# 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
```

执行

```sh
source /etc/profile
```

#### 安装 pm2

```sh
 npm install pm2@latest -g
```

**注意:详细使用可参考 [pm2 官网](https://github.com/Unitech/pm2)**

内容为

#### 部署平台发行包

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

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

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

---
_Source: https://npm.io/package/track-proxy-hxm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
