# @abtnode/router-provider

> Routing engine implementations for abt node

Latest version **1.17.12** (published 2026-04-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @abtnode/router-provider
pnpm add @abtnode/router-provider
yarn add @abtnode/router-provider
bun add @abtnode/router-provider
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

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

## Facts

| | |
|---|---|
| Version | 1.17.12 |
| Published | 2026-04-22 |
| First published | 2020-07-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 25 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | polunzh |
| Maintainers | wangshijun, polunzh, mave99a |

## Links

- npm: https://www.npmjs.com/package/@abtnode/router-provider
- Repository: https://github.com/ArcBlock/blocklet-server
- Homepage: https://github.com/ArcBlock/blocklet-server#readme
- Issues: https://github.com/ArcBlock/blocklet-server/issues
- npm.io page: https://npm.io/package/@abtnode/router-provider

## Dependencies (25)

- [tar](https://npm.io/package/tar.md) ^6.1.11
- [ufo](https://npm.io/package/ufo.md) ^1.5.3
- [axios](https://npm.io/package/axios.md) ^1.7.9
- [debug](https://npm.io/package/debug.md) ^4.4.1
- [fkill](https://npm.io/package/fkill.md) ^7.2.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [semver](https://npm.io/package/semver.md) ^7.6.3
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.5
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.2.0
- [get-port](https://npm.io/package/get-port.md) ^5.1.1
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.3.2
- [port-used](https://npm.io/package/port-used.md) ^2.0.8
- [valid-url](https://npm.io/package/valid-url.md) ^1.0.9
- [@ocap/util](https://npm.io/package/@ocap/util.md) 1.29.27
- [nginx-conf](https://npm.io/package/nginx-conf.md) ^1.7.0
- [object-hash](https://npm.io/package/object-hash.md) ^3.0.0
- [find-process](https://npm.io/package/find-process.md) ^1.4.7
- [@abtnode/util](https://npm.io/package/@abtnode/util.md) 1.17.12
- [promise-retry](https://npm.io/package/promise-retry.md) ^2.0.1
- [@abtnode/logger](https://npm.io/package/@abtnode/logger.md) 1.17.12
- [@abtnode/constant](https://npm.io/package/@abtnode/constant.md) 1.17.12
- [@abtnode/db-cache](https://npm.io/package/@abtnode/db-cache.md) 1.17.12
- [@arcblock/http-proxy](https://npm.io/package/@arcblock/http-proxy.md) ^1.19.1
- [@abtnode/router-templates](https://npm.io/package/@abtnode/router-templates.md) 1.17.12
- [@arcblock/is-valid-domain](https://npm.io/package/@arcblock/is-valid-domain.md) ^1.0.5

## Recent versions

- 1.17.12 (latest) — 2026-04-22
- 1.17.13-beta-20261020-042751-541e5c03 (beta) — 2026-10-20
- 1.16.29-next-680cf137 (next) — 2024-07-19
- 1.2.0-prerelease.1 (prelease) — 2021-02-08
- 1.17.13-beta-20261019-135643-7047c876 — 2026-10-19
- 1.17.13-beta-20261019-111429-5cdb5af8 — 2026-10-19
- 1.17.13-beta-20261019-082907-fe71de61 — 2026-10-19
- 1.17.13-beta-20261019-070231-87338763 — 2026-10-19
- 1.17.13-beta-20261019-060220-4c251fcf — 2026-10-19
- 1.17.13-beta-20261019-013222-23d4b329 — 2026-10-19
- 1.17.13-beta-20261018-133339-4428feb0 — 2026-10-18
- 1.17.13-beta-20261018-131740-92d9b271 — 2026-10-18
- 1.17.13-beta-20261018-112055-27bdf21c — 2026-10-18
- 1.17.13-beta-20261018-074057-557246bf — 2026-10-18
- 1.17.13-beta-20261018-055715-2b3472bb — 2026-10-18
- … 1159 more at https://npm.io/package/@abtnode/router-provider/versions

## README

# `router-provider`

The routing provider for ABT Node, which contains several routing engine implementations.

## Usage

```javascript
const { getProvider } = require('router-provider');
const providerName = 'nginx';
const Provider = getProvider(providerName);

const provider = new Provider({ configDir, httpPort: 80, httpsPort: 443 });
provider.start();
provider.stop();
// ...
```

## Run Test

The tests are divided into two parts: the general unit tests and the generated gateway.spec.js tests. The reason for the two parts is that gateway.spec.js has some port & nginx dependencies.

### General unit testing

```bash
npm run test
```

### gateway.spec.js

The test relies on docker, so you need to have docker installed on your computer to start the test.
The `gateway.spec.js` file is not included in the source code, it is generated during the test, so if you need to see the file, you need to generate it manually.

```bash
pwd
/project/abt-node/core/router-provider
npm run test:generate-gateway
```

The generated file is in `/project/abt-node/core/router-provider/tests/gateway.spec.js`.

To save resources, this part of the test is not installed separately from the dependencies, so you need to start the test in the project's heel directory:

```bash
pwd
/project/abt-node
make test-in-docker
```

## Contribution

There are various ways for you to contribute to this package, such as adding support for another routing engine:

- [ ] Apache
- [ ] Openresty
- [ ] Tengine
- [ ] AWS ELB
- [x] Node.js
- [x] Nginx: supported

If you are working with the nginx routing engine, you may found this tool useful: <https://nginx.viraptor.info/>

## How to update the CRS rules

1. Pull the latest rules from the CRS repository
2. Copy the rules in the `lib/nginx/includes/security/crs4/rules` directory
3. Disable rules for windows in `lib/nginx/includes/security/crs4/rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf`

---
_Source: https://npm.io/package/@abtnode/router-provider · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
