redis-smq-web-server 10.1.2 → 11.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +17 -18
- package/package.json +10 -10
- package/README.template.md +0 -52
- package/dist/cjs/bin/cli.d.ts +0 -3
- package/dist/cjs/bin/cli.d.ts.map +0 -1
- package/dist/cjs/bin/cli.js +0 -48
- package/dist/cjs/bin/cli.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -3
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -19
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/src/config/parse-config.d.ts +0 -4
- package/dist/cjs/src/config/parse-config.d.ts.map +0 -1
- package/dist/cjs/src/config/parse-config.js +0 -36
- package/dist/cjs/src/config/parse-config.js.map +0 -1
- package/dist/cjs/src/config/types/index.d.ts +0 -28
- package/dist/cjs/src/config/types/index.d.ts.map +0 -1
- package/dist/cjs/src/config/types/index.js +0 -3
- package/dist/cjs/src/config/types/index.js.map +0 -1
- package/dist/cjs/src/index.d.ts +0 -22
- package/dist/cjs/src/index.d.ts.map +0 -1
- package/dist/cjs/src/index.js +0 -175
- package/dist/cjs/src/index.js.map +0 -1
- package/dist/cjs/tests/common/config.d.ts +0 -3
- package/dist/cjs/tests/common/config.d.ts.map +0 -1
- package/dist/cjs/tests/common/config.js +0 -24
- package/dist/cjs/tests/common/config.js.map +0 -1
- package/dist/cjs/tests/common/redis-client.d.ts +0 -113
- package/dist/cjs/tests/common/redis-client.d.ts.map +0 -1
- package/dist/cjs/tests/common/redis-client.js +0 -41
- package/dist/cjs/tests/common/redis-client.js.map +0 -1
- package/dist/cjs/tests/common/start-api-server.d.ts +0 -3
- package/dist/cjs/tests/common/start-api-server.d.ts.map +0 -1
- package/dist/cjs/tests/common/start-api-server.js +0 -39
- package/dist/cjs/tests/common/start-api-server.js.map +0 -1
- package/dist/cjs/tests/common/start-cli.d.ts +0 -10
- package/dist/cjs/tests/common/start-cli.d.ts.map +0 -1
- package/dist/cjs/tests/common/start-cli.js +0 -70
- package/dist/cjs/tests/common/start-cli.js.map +0 -1
- package/dist/cjs/tests/common/start-redis-server.d.ts +0 -3
- package/dist/cjs/tests/common/start-redis-server.d.ts.map +0 -1
- package/dist/cjs/tests/common/start-redis-server.js +0 -37
- package/dist/cjs/tests/common/start-redis-server.js.map +0 -1
- package/dist/cjs/tests/common/start-web-server.d.ts +0 -3
- package/dist/cjs/tests/common/start-web-server.d.ts.map +0 -1
- package/dist/cjs/tests/common/start-web-server.js +0 -33
- package/dist/cjs/tests/common/start-web-server.js.map +0 -1
- package/dist/cjs/tests/setup.d.ts +0 -2
- package/dist/cjs/tests/setup.d.ts.map +0 -1
- package/dist/cjs/tests/setup.js +0 -32
- package/dist/cjs/tests/setup.js.map +0 -1
- package/dist/cjs/tests/tests/test00001.test.d.ts +0 -2
- package/dist/cjs/tests/tests/test00001.test.d.ts.map +0 -1
- package/dist/cjs/tests/tests/test00001.test.js +0 -114
- package/dist/cjs/tests/tests/test00001.test.js.map +0 -1
- package/dist/cjs/tests/tests/test00002.test.d.ts +0 -2
- package/dist/cjs/tests/tests/test00002.test.d.ts.map +0 -1
- package/dist/cjs/tests/tests/test00002.test.js +0 -70
- package/dist/cjs/tests/tests/test00002.test.js.map +0 -1
- package/dist/cjs/tests/tests/test00003.test.d.ts +0 -2
- package/dist/cjs/tests/tests/test00003.test.d.ts.map +0 -1
- package/dist/cjs/tests/tests/test00003.test.js +0 -48
- package/dist/cjs/tests/tests/test00003.test.js.map +0 -1
- package/dist/cjs/tests/tests/test00004.test.d.ts +0 -2
- package/dist/cjs/tests/tests/test00004.test.d.ts.map +0 -1
- package/dist/cjs/tests/tests/test00004.test.js +0 -51
- package/dist/cjs/tests/tests/test00004.test.js.map +0 -1
- package/dist/cjs/tests/tests/test00005.test.d.ts +0 -2
- package/dist/cjs/tests/tests/test00005.test.d.ts.map +0 -1
- package/dist/cjs/tests/tests/test00005.test.js +0 -49
- package/dist/cjs/tests/tests/test00005.test.js.map +0 -1
- package/dist/esm/bin/cli.d.ts +0 -3
- package/dist/esm/bin/cli.d.ts.map +0 -1
- package/dist/esm/bin/cli.js.map +0 -1
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/src/config/parse-config.d.ts +0 -4
- package/dist/esm/src/config/parse-config.d.ts.map +0 -1
- package/dist/esm/src/config/parse-config.js +0 -41
- package/dist/esm/src/config/parse-config.js.map +0 -1
- package/dist/esm/src/config/types/index.d.ts +0 -28
- package/dist/esm/src/config/types/index.d.ts.map +0 -1
- package/dist/esm/src/config/types/index.js +0 -2
- package/dist/esm/src/config/types/index.js.map +0 -1
- package/dist/esm/src/index.d.ts +0 -22
- package/dist/esm/src/index.d.ts.map +0 -1
- package/dist/esm/src/index.js +0 -149
- package/dist/esm/src/index.js.map +0 -1
- package/dist/esm/tests/common/config.d.ts +0 -3
- package/dist/esm/tests/common/config.d.ts.map +0 -1
- package/dist/esm/tests/common/config.js +0 -21
- package/dist/esm/tests/common/config.js.map +0 -1
- package/dist/esm/tests/common/redis-client.d.ts +0 -113
- package/dist/esm/tests/common/redis-client.d.ts.map +0 -1
- package/dist/esm/tests/common/redis-client.js +0 -21
- package/dist/esm/tests/common/redis-client.js.map +0 -1
- package/dist/esm/tests/common/start-api-server.d.ts +0 -3
- package/dist/esm/tests/common/start-api-server.d.ts.map +0 -1
- package/dist/esm/tests/common/start-api-server.js +0 -22
- package/dist/esm/tests/common/start-api-server.js.map +0 -1
- package/dist/esm/tests/common/start-cli.d.ts +0 -10
- package/dist/esm/tests/common/start-cli.d.ts.map +0 -1
- package/dist/esm/tests/common/start-cli.js +0 -54
- package/dist/esm/tests/common/start-cli.js.map +0 -1
- package/dist/esm/tests/common/start-redis-server.d.ts +0 -3
- package/dist/esm/tests/common/start-redis-server.d.ts.map +0 -1
- package/dist/esm/tests/common/start-redis-server.js +0 -22
- package/dist/esm/tests/common/start-redis-server.js.map +0 -1
- package/dist/esm/tests/common/start-web-server.d.ts +0 -3
- package/dist/esm/tests/common/start-web-server.d.ts.map +0 -1
- package/dist/esm/tests/common/start-web-server.js +0 -16
- package/dist/esm/tests/common/start-web-server.js.map +0 -1
- package/dist/esm/tests/setup.d.ts +0 -2
- package/dist/esm/tests/setup.d.ts.map +0 -1
- package/dist/esm/tests/setup.js +0 -21
- package/dist/esm/tests/setup.js.map +0 -1
- package/dist/esm/tests/tests/test00001.test.d.ts +0 -2
- package/dist/esm/tests/tests/test00001.test.d.ts.map +0 -1
- package/dist/esm/tests/tests/test00001.test.js +0 -99
- package/dist/esm/tests/tests/test00001.test.js.map +0 -1
- package/dist/esm/tests/tests/test00002.test.d.ts +0 -2
- package/dist/esm/tests/tests/test00002.test.d.ts.map +0 -1
- package/dist/esm/tests/tests/test00002.test.js +0 -59
- package/dist/esm/tests/tests/test00002.test.js.map +0 -1
- package/dist/esm/tests/tests/test00003.test.d.ts +0 -2
- package/dist/esm/tests/tests/test00003.test.d.ts.map +0 -1
- package/dist/esm/tests/tests/test00003.test.js +0 -33
- package/dist/esm/tests/tests/test00003.test.js.map +0 -1
- package/dist/esm/tests/tests/test00004.test.d.ts +0 -2
- package/dist/esm/tests/tests/test00004.test.d.ts.map +0 -1
- package/dist/esm/tests/tests/test00004.test.js +0 -37
- package/dist/esm/tests/tests/test00004.test.js.map +0 -1
- package/dist/esm/tests/tests/test00005.test.d.ts +0 -2
- package/dist/esm/tests/tests/test00005.test.d.ts.map +0 -1
- package/dist/esm/tests/tests/test00005.test.js +0 -35
- package/dist/esm/tests/tests/test00005.test.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.0.0-next.0](https://github.com/weyoss/redis-smq/compare/v10.1.2...v11.0.0-next.0) (2026-10-10)
|
|
7
|
+
|
|
8
|
+
### 🐛 Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **redis-smq-web-server:** use regex wildcard for SPA fallback route ([35b43c3](https://github.com/weyoss/redis-smq/commit/35b43c3a8bcc4b436360943eeee1c83aa0f3ce80))
|
|
11
|
+
|
|
12
|
+
### 🚀 Chore
|
|
13
|
+
|
|
14
|
+
- update deps to latest versions ([06bc58f](https://github.com/weyoss/redis-smq/commit/06bc58f948fcedbffae32c206ad07056e440ab37))
|
|
15
|
+
- update minimal supported Node.js LTS version ([475fef3](https://github.com/weyoss/redis-smq/commit/475fef3138fd0df4773a2ee058d7bee2a250a14b))
|
|
16
|
+
|
|
17
|
+
### 📝 Documentation
|
|
18
|
+
|
|
19
|
+
- make READMEs branch-independent and master-focused ([e364650](https://github.com/weyoss/redis-smq/commit/e3646507f31dbf144a5c3829c7703c769f9ba54e))
|
|
20
|
+
- update READMEs (v10.1.2 → next) ([d1db802](https://github.com/weyoss/redis-smq/commit/d1db802dc175c3c4608057e8b18d17f2bf41e7ac))
|
|
21
|
+
|
|
6
22
|
## [10.1.2](https://github.com/weyoss/redis-smq/compare/v10.1.2-next.1...v10.1.2) (2026-04-18)
|
|
7
23
|
|
|
8
24
|
> 📖 **Detailed Release Notes**: [RedisSMQ v10.1.2](https://github.com/weyoss/redis-smq/blob/master/release-notes/release-v10.1.2.md)
|
package/README.md
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
# RedisSMQ Web Server
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
> 💡 **Note:** You are on the stable `master` branch. For the latest features (including breaking changes), check the [`next` branch](https://github.com/weyoss/redis-smq/tree/next/packages/redis-smq-web-server).
|
|
7
|
-
|
|
8
|
-
A lightweight server that brings the RedisSMQ management ecosystem to life. It serves the official Web UI and provides
|
|
9
|
-
the REST API through two flexible modes of operation:
|
|
3
|
+
`redis-smq-web-server` - A lightweight server that brings the RedisSMQ management ecosystem to life. It serves the
|
|
4
|
+
official Web UI and provides the REST API through two flexible modes of operation:
|
|
10
5
|
|
|
11
6
|
- **Standalone Mode:** Run the Web UI and REST API in a single process for an all-in-one setup.
|
|
12
7
|
- **Proxy Mode:** Serve the Web UI and proxy API requests to a separate redis-smq-rest-api instance for distributed deployments.
|
|
13
8
|
|
|
9
|
+
This package is part of the [RedisSMQ monorepo](https://github.com/weyoss/redis-smq), which contains the full TypeScript implementation.
|
|
10
|
+
|
|
11
|
+
## Release Status & Code Coverage
|
|
12
|
+
|
|
13
|
+
| Branch | Latest Release | Code Coverage |
|
|
14
|
+
|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
15
|
+
| `master` | [](https://www.npmjs.com/package/redis-smq-web-server/v/latest) | [](https://app.codecov.io/github/weyoss/redis-smq/tree/master/packages/redis-smq-web-server) |
|
|
16
|
+
| `next` | [](https://www.npmjs.com/package/redis-smq-web-server/v/next) | [](https://app.codecov.io/github/weyoss/redis-smq/tree/next/packages/redis-smq-web-server) |
|
|
17
|
+
|
|
18
|
+
> **📌 Note:** The `master` branch always points to the latest **stable, production-ready** release. The `next` branch contains **bleeding-edge development**—new features, fixes, and experimental changes that are not yet considered stable.
|
|
19
|
+
|
|
14
20
|
## Features
|
|
15
21
|
|
|
16
22
|
- **Dual-Mode Operation:** Standalone (UI + API in one process) or Proxy (UI + proxied API).
|
|
@@ -21,7 +27,7 @@ the REST API through two flexible modes of operation:
|
|
|
21
27
|
|
|
22
28
|
```bash
|
|
23
29
|
# Using npm
|
|
24
|
-
npm install redis-smq redis-smq-common redis-smq-rest-api redis-smq-web-ui redis-smq-web-server --save
|
|
30
|
+
npm install redis-smq@next redis-smq-common@next redis-smq-rest-api@next redis-smq-web-ui@next redis-smq-web-server@next --save
|
|
25
31
|
```
|
|
26
32
|
|
|
27
33
|
Don't forget to install a Redis client:
|
|
@@ -34,19 +40,12 @@ npm install ioredis --save
|
|
|
34
40
|
|
|
35
41
|
## Version Compatibility
|
|
36
42
|
|
|
37
|
-
Always install matching versions of RedisSMQ packages to ensure compatibility. See [version compatibility](
|
|
43
|
+
Always install matching versions of RedisSMQ packages to ensure compatibility. See [version compatibility](../redis-smq/docs/version-compatibility.md) for details.
|
|
38
44
|
|
|
39
45
|
## Documentation
|
|
40
46
|
|
|
41
|
-
For in-depth guides and API references, see [the documentation page](
|
|
42
|
-
|
|
43
|
-
## Related packages
|
|
44
|
-
|
|
45
|
-
- [redis-smq](https://github.com/weyoss/redis-smq/tree/master/packages/redis-smq/README.md): Core message queue
|
|
46
|
-
- [redis-smq-common](https://github.com/weyoss/redis-smq/tree/master/packages/redis-smq-common/README.md): Shared components/utilities
|
|
47
|
-
- [redis-smq-rest-api](https://github.com/weyoss/redis-smq/tree/master/packages/redis-smq-rest-api/README.md): REST API with OpenAPI v3 and Swagger UI
|
|
48
|
-
- [redis-smq-web-ui](https://github.com/weyoss/redis-smq/tree/master/packages/redis-smq-web-ui/README.md): SPA for monitoring and managing RedisSMQ
|
|
47
|
+
For in-depth guides and API references, see [the documentation page](docs/README.md).
|
|
49
48
|
|
|
50
49
|
## License
|
|
51
50
|
|
|
52
|
-
RedisSMQ Web Server is released under the [MIT License](
|
|
51
|
+
RedisSMQ Web Server is released under the [MIT License](../../LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redis-smq-web-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0-next.0",
|
|
4
4
|
"description": "Web server for RedisSMQ Web UI: serves the SPA and hosts or proxies the RedisSMQ REST API.",
|
|
5
5
|
"author": "Weyoss <weyoss@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
"redis-smq-web-server": "./dist/esm/bin/cli.js"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"commander": "
|
|
48
|
-
"express": "
|
|
49
|
-
"http-proxy-middleware": "
|
|
47
|
+
"commander": "15.0.0",
|
|
48
|
+
"express": "5.2.1",
|
|
49
|
+
"http-proxy-middleware": "4.2.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@types/express": "
|
|
52
|
+
"@types/express": "5.0.6"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@redis/client": "^5",
|
|
56
56
|
"ioredis": "^5",
|
|
57
|
-
"redis-smq": "^
|
|
58
|
-
"redis-smq-common": "^
|
|
59
|
-
"redis-smq-rest-api": "^
|
|
60
|
-
"redis-smq-web-ui": "^
|
|
57
|
+
"redis-smq": "^11.0.0-next.0",
|
|
58
|
+
"redis-smq-common": "^11.0.0-next.0",
|
|
59
|
+
"redis-smq-rest-api": "^11.0.0-next.0",
|
|
60
|
+
"redis-smq-web-ui": "^11.0.0-next.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"@redis/client": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"engineStrict": true,
|
|
71
71
|
"engines": {
|
|
72
|
-
"node": ">=
|
|
72
|
+
"node": ">=22"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "scripts/build.sh",
|
package/README.template.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# RedisSMQ Web Server
|
|
2
|
-
|
|
3
|
-
__NPM_BADGE__
|
|
4
|
-
__CODECOV_BADGE__
|
|
5
|
-
|
|
6
|
-
__IS_NEXT_NOTE__
|
|
7
|
-
|
|
8
|
-
A lightweight server that brings the RedisSMQ management ecosystem to life. It serves the official Web UI and provides
|
|
9
|
-
the REST API through two flexible modes of operation:
|
|
10
|
-
|
|
11
|
-
- **Standalone Mode:** Run the Web UI and REST API in a single process for an all-in-one setup.
|
|
12
|
-
- **Proxy Mode:** Serve the Web UI and proxy API requests to a separate redis-smq-rest-api instance for distributed deployments.
|
|
13
|
-
|
|
14
|
-
## Features
|
|
15
|
-
|
|
16
|
-
- **Dual-Mode Operation:** Standalone (UI + API in one process) or Proxy (UI + proxied API).
|
|
17
|
-
- **Versatile Execution:** Start from the CLI as a standalone server or embed as a library in your Node.js app.
|
|
18
|
-
- **Consistent Ecosystem:** Works seamlessly with `redis-smq`, `redis-smq-rest-api`, and `redis-smq-web-ui`.
|
|
19
|
-
|
|
20
|
-
## Installation
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
# Using npm
|
|
24
|
-
npm install redis-smq__TAG_SUFFIX__ redis-smq-common__TAG_SUFFIX__ redis-smq-rest-api__TAG_SUFFIX__ redis-smq-web-ui__TAG_SUFFIX__ redis-smq-web-server__TAG_SUFFIX__ --save
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Don't forget to install a Redis client:
|
|
28
|
-
|
|
29
|
-
```shell
|
|
30
|
-
npm install @redis/client --save
|
|
31
|
-
# or
|
|
32
|
-
npm install ioredis --save
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Version Compatibility
|
|
36
|
-
|
|
37
|
-
Always install matching versions of RedisSMQ packages to ensure compatibility. See [version compatibility](https://github.com/weyoss/redis-smq/tree/__BRANCH_NAME__/packages/redis-smq/docs/version-compatibility.md) for details.
|
|
38
|
-
|
|
39
|
-
## Documentation
|
|
40
|
-
|
|
41
|
-
For in-depth guides and API references, see [the documentation page](https://github.com/weyoss/redis-smq/tree/__BRANCH_NAME__/packages/redis-smq-web-server/docs/README.md).
|
|
42
|
-
|
|
43
|
-
## Related packages
|
|
44
|
-
|
|
45
|
-
- [redis-smq](https://github.com/weyoss/redis-smq/tree/__BRANCH_NAME__/packages/redis-smq/README.md): Core message queue
|
|
46
|
-
- [redis-smq-common](https://github.com/weyoss/redis-smq/tree/__BRANCH_NAME__/packages/redis-smq-common/README.md): Shared components/utilities
|
|
47
|
-
- [redis-smq-rest-api](https://github.com/weyoss/redis-smq/tree/__BRANCH_NAME__/packages/redis-smq-rest-api/README.md): REST API with OpenAPI v3 and Swagger UI
|
|
48
|
-
- [redis-smq-web-ui](https://github.com/weyoss/redis-smq/tree/__BRANCH_NAME__/packages/redis-smq-web-ui/README.md): SPA for monitoring and managing RedisSMQ
|
|
49
|
-
|
|
50
|
-
## License
|
|
51
|
-
|
|
52
|
-
RedisSMQ Web Server is released under the [MIT License](https://github.com/weyoss/redis-smq/tree/__BRANCH_NAME__/LICENSE).
|
package/dist/cjs/bin/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../bin/cli.ts"],"names":[],"mappings":""}
|
package/dist/cjs/bin/cli.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var _a, _b, _c;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
const commander_1 = require("commander");
|
|
6
|
-
const index_js_1 = require("../src/index.js");
|
|
7
|
-
const parse_config_js_1 = require("../src/config/parse-config.js");
|
|
8
|
-
const redis_smq_common_1 = require("redis-smq-common");
|
|
9
|
-
const program = new commander_1.Command();
|
|
10
|
-
program
|
|
11
|
-
.name('redis-smq-web-server')
|
|
12
|
-
.description('Web server for RedisSMQ Web UI');
|
|
13
|
-
program
|
|
14
|
-
.option('-p, --port <number>', 'Port to run the server on', String((_a = parse_config_js_1.defaultConfig.webServer) === null || _a === void 0 ? void 0 : _a.port))
|
|
15
|
-
.option('-b, --base-path <string>', 'Base public path for the RedisSMQ Web UI SPA', (_b = parse_config_js_1.defaultConfig.webServer) === null || _b === void 0 ? void 0 : _b.basePath)
|
|
16
|
-
.option('-t, --api-proxy-target <string>', 'Proxy target for API (/api, /swagger). Example: http://127.0.0.1:6000', (_c = parse_config_js_1.defaultConfig.webServer) === null || _c === void 0 ? void 0 : _c.apiProxyTarget)
|
|
17
|
-
.option('-c, --redis-client <ioredis|redis>', 'Redis client. Valid options are: ioredis, redis.', redis_smq_common_1.ERedisConfigClient.IOREDIS)
|
|
18
|
-
.option('-r, --redis-host <string>', 'Redis server host', '127.0.0.1')
|
|
19
|
-
.option('-o, --redis-port <number>', 'Redis server port', '6379')
|
|
20
|
-
.option('-d, --redis-db <number>', 'Redis database number', '0')
|
|
21
|
-
.option('-e, --enable-log <0|1>', 'Enable console logging. Valid options are: 0, 1', '0')
|
|
22
|
-
.option('-v, --log-level <0|1|2|3>', `Log level. Numbers: ${redis_smq_common_1.EConsoleLoggerLevel.DEBUG}=DEBUG, ${redis_smq_common_1.EConsoleLoggerLevel.INFO}=INFO, ${redis_smq_common_1.EConsoleLoggerLevel.WARN}=WARN, ${redis_smq_common_1.EConsoleLoggerLevel.ERROR}=ERROR`, 'INFO');
|
|
23
|
-
program.parse();
|
|
24
|
-
const options = program.opts();
|
|
25
|
-
const config = {
|
|
26
|
-
webServer: {
|
|
27
|
-
port: Number(options.port),
|
|
28
|
-
basePath: options.basePath,
|
|
29
|
-
apiProxyTarget: options.apiProxyTarget,
|
|
30
|
-
},
|
|
31
|
-
redis: {
|
|
32
|
-
client: options.redisClient,
|
|
33
|
-
options: {
|
|
34
|
-
host: options.redisHost,
|
|
35
|
-
port: Number(options.redisPort),
|
|
36
|
-
db: Number(options.redisDb),
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
logger: {
|
|
40
|
-
enabled: Boolean(Number(options.enableLog)),
|
|
41
|
-
options: {
|
|
42
|
-
logLevel: Number(options.logLevel),
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
const server = new index_js_1.RedisSMQWebServer(config);
|
|
47
|
-
server.run();
|
|
48
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/cjs/bin/cli.js.map
DELETED
|
@@ -1 +0,0 @@
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AC,IAAI,CAAC;QAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC;IACD,KAAK,EAAE;QACL,MAAM,EAAE,OAAO,CAAC,WAAW;QAC3B,OAAO,EAAE;YACP,IAAI,EAAE,OAAO,CAAC,SAAS;YACvB,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;YAC/B,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SAC5B;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3C,OAAO,EAAE;YACP,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SACnC;KACF;CACF,CAAC;AAEF,MAAM,MAAM,GAAG,IAAI,4BAAiB,CAAC,MAAM,CAAC,CAAC;AAC7C,MAAM,CAAC,GAAG,EAAE,CAAC"}
|
package/dist/cjs/index.d.ts
DELETED
package/dist/cjs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AASA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC"}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./src/config/types/index.js"), exports);
|
|
18
|
-
__exportStar(require("./src/index.js"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AASA,8DAA4C;AAC5C,iDAA+B"}
|
package/dist/cjs/package.json
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IRedisSMQWebServerConfig, IRedisSMQWebServerParsedConfig } from './types/index.js';
|
|
2
|
-
export declare const defaultConfig: IRedisSMQWebServerConfig;
|
|
3
|
-
export declare function parseConfig(config?: Partial<IRedisSMQWebServerConfig>): IRedisSMQWebServerParsedConfig;
|
|
4
|
-
//# sourceMappingURL=parse-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-config.d.ts","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":"AASA,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,aAAa,EAAE,wBAM3B,CAAC;AAMF,wBAAgB,WAAW,CACzB,MAAM,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAC7C,8BAA8B,CA0ChC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultConfig = void 0;
|
|
4
|
-
exports.parseConfig = parseConfig;
|
|
5
|
-
const redis_smq_rest_api_1 = require("redis-smq-rest-api");
|
|
6
|
-
exports.defaultConfig = {
|
|
7
|
-
webServer: {
|
|
8
|
-
port: 8080,
|
|
9
|
-
basePath: '/',
|
|
10
|
-
apiProxyTarget: undefined,
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
function parseConfig(config = {}) {
|
|
14
|
-
var _a;
|
|
15
|
-
const restApiParsedConfig = (0, redis_smq_rest_api_1.parseConfig)(config);
|
|
16
|
-
const normalizePath = (path) => {
|
|
17
|
-
const s = path
|
|
18
|
-
.split('/')
|
|
19
|
-
.map((i) => i.trim())
|
|
20
|
-
.filter((i) => !!i)
|
|
21
|
-
.join('/');
|
|
22
|
-
return `/${s}`;
|
|
23
|
-
};
|
|
24
|
-
const basePath = ((_a = config.webServer) === null || _a === void 0 ? void 0 : _a.basePath) !== undefined
|
|
25
|
-
? normalizePath(config.webServer.basePath)
|
|
26
|
-
: restApiParsedConfig.apiServer.basePath;
|
|
27
|
-
const webServer = Object.assign(Object.assign({}, exports.defaultConfig.webServer), config.webServer);
|
|
28
|
-
return Object.assign(Object.assign({}, restApiParsedConfig), { apiServer: Object.assign(Object.assign({}, restApiParsedConfig.apiServer), { basePath: basePath }), webServer: {
|
|
29
|
-
port: Number(webServer.port),
|
|
30
|
-
basePath: basePath,
|
|
31
|
-
apiProxyTarget: webServer.apiProxyTarget
|
|
32
|
-
? String(webServer.apiProxyTarget)
|
|
33
|
-
: undefined,
|
|
34
|
-
} });
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=parse-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-config.js","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":";;;AA2BA,kCA4CC;AA1DD,2DAAuE;AAE1D,QAAA,aAAa,GAA6B;IACrD,SAAS,EAAE;QACT,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,GAAG;QACb,cAAc,EAAE,SAAS;KAC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smq-common';
|
|
3
|
-
export interface IRedisSMQWebServerCliOptions {
|
|
4
|
-
port: string;
|
|
5
|
-
basePath: string;
|
|
6
|
-
redisClient: ERedisConfigClient;
|
|
7
|
-
redisPort: string;
|
|
8
|
-
redisHost: string;
|
|
9
|
-
redisDb: string;
|
|
10
|
-
enableLog: string;
|
|
11
|
-
logLevel: EConsoleLoggerLevel;
|
|
12
|
-
apiProxyTarget?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface IRedisSMQWebServerConfig extends Omit<IRedisSMQRestApiConfig, 'apiServer'> {
|
|
15
|
-
webServer?: {
|
|
16
|
-
port?: number;
|
|
17
|
-
basePath?: string;
|
|
18
|
-
apiProxyTarget?: string;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export interface IRedisSMQWebServerParsedConfig extends IRedisSMQRestApiParsedConfig {
|
|
22
|
-
webServer: {
|
|
23
|
-
port: number;
|
|
24
|
-
basePath: string;
|
|
25
|
-
apiProxyTarget?: string;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/config/types/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK3E,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,mBAAmB,CAAC;IAK9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAWD,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACjD,SAAS,CAAC,EAAE;QAKV,IAAI,CAAC,EAAE,MAAM,CAAC;QAQd,QAAQ,CAAC,EAAE,MAAM,CAAC;QASlB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAMD,MAAM,WAAW,8BACf,SAAQ,4BAA4B;IACpC,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QAKjB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/config/types/index.ts"],"names":[],"mappings":""}
|
package/dist/cjs/src/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IRedisSMQWebServerConfig } from './config/types/index.js';
|
|
2
|
-
import { ILogger } from 'redis-smq-common';
|
|
3
|
-
export declare class RedisSMQWebServer {
|
|
4
|
-
private readonly app;
|
|
5
|
-
private readonly config;
|
|
6
|
-
private readonly webUIPath;
|
|
7
|
-
private readonly webUIConfig;
|
|
8
|
-
private readonly apiProxyTarget;
|
|
9
|
-
private restApi;
|
|
10
|
-
private bootstrapped;
|
|
11
|
-
private httpServer;
|
|
12
|
-
protected logger: ILogger;
|
|
13
|
-
constructor(config?: IRedisSMQWebServerConfig);
|
|
14
|
-
private setupMiddleware;
|
|
15
|
-
private setupApi;
|
|
16
|
-
private sendIndexHtml;
|
|
17
|
-
private setupRoutes;
|
|
18
|
-
private bootstrap;
|
|
19
|
-
run(): Promise<void>;
|
|
20
|
-
shutdown(): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAgB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAMzD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiC;IACxD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAA4B;IAC9C,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;gBAEd,MAAM,GAAE,wBAA6B;YAYnC,eAAe;YA0Bf,QAAQ;IAsCtB,OAAO,CAAC,aAAa;YAeP,WAAW;YA6BX,SAAS;IAQV,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAepB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAgBvC"}
|
package/dist/cjs/src/index.js
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RedisSMQWebServer = void 0;
|
|
16
|
-
const express_1 = __importDefault(require("express"));
|
|
17
|
-
const path_1 = __importDefault(require("path"));
|
|
18
|
-
const fs_1 = __importDefault(require("fs"));
|
|
19
|
-
const redis_smq_web_ui_1 = require("redis-smq-web-ui");
|
|
20
|
-
const redis_smq_rest_api_1 = require("redis-smq-rest-api");
|
|
21
|
-
const parse_config_js_1 = require("./config/parse-config.js");
|
|
22
|
-
const http_proxy_middleware_1 = require("http-proxy-middleware");
|
|
23
|
-
const redis_smq_common_1 = require("redis-smq-common");
|
|
24
|
-
class RedisSMQWebServer {
|
|
25
|
-
constructor(config = {}) {
|
|
26
|
-
var _a;
|
|
27
|
-
this.app = (0, express_1.default)();
|
|
28
|
-
this.apiProxyTarget = null;
|
|
29
|
-
this.restApi = null;
|
|
30
|
-
this.bootstrapped = false;
|
|
31
|
-
this.httpServer = null;
|
|
32
|
-
this.config = (0, parse_config_js_1.parseConfig)(config);
|
|
33
|
-
this.webUIConfig = {
|
|
34
|
-
BASE_PATH: this.config.webServer.basePath,
|
|
35
|
-
API_URL: this.config.webServer.basePath,
|
|
36
|
-
};
|
|
37
|
-
this.apiProxyTarget = (_a = this.config.webServer.apiProxyTarget) !== null && _a !== void 0 ? _a : null;
|
|
38
|
-
this.webUIPath = (0, redis_smq_web_ui_1.getDistPath)();
|
|
39
|
-
this.logger = (0, redis_smq_common_1.createLogger)(this.config.logger, 'RedisSMQWebServer');
|
|
40
|
-
}
|
|
41
|
-
setupMiddleware() {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const { basePath } = this.config.webServer;
|
|
44
|
-
this.app.set('trust proxy', true);
|
|
45
|
-
this.logger.info('Trusting reverse proxy headers.');
|
|
46
|
-
this.app.use(basePath, express_1.default.static(this.webUIPath, {
|
|
47
|
-
etag: true,
|
|
48
|
-
lastModified: true,
|
|
49
|
-
index: false,
|
|
50
|
-
setHeaders: (res, filePath) => {
|
|
51
|
-
if (filePath.match(/\.(png|jpg|jpeg|gif|ico|svg|css|js)$/)) {
|
|
52
|
-
res.setHeader('Cache-Control', 'public, max-age=86400');
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
res.setHeader('Cache-Control', 'no-cache');
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
}));
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
setupApi() {
|
|
62
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
const basePath = this.config.webServer.basePath;
|
|
64
|
-
const apiPath = path_1.default.posix.join(basePath, 'api');
|
|
65
|
-
const swaggerPath = path_1.default.posix.join(basePath, 'swagger');
|
|
66
|
-
const apiBasePaths = [apiPath, swaggerPath];
|
|
67
|
-
const isApiRequest = (path) => apiBasePaths.some((base) => path === base || path.startsWith(`${base}/`));
|
|
68
|
-
const target = this.config.webServer.apiProxyTarget;
|
|
69
|
-
if (target) {
|
|
70
|
-
const proxy = (0, http_proxy_middleware_1.createProxyMiddleware)({
|
|
71
|
-
target,
|
|
72
|
-
changeOrigin: true,
|
|
73
|
-
ws: true,
|
|
74
|
-
});
|
|
75
|
-
this.app.use((req, res, next) => {
|
|
76
|
-
if (isApiRequest(req.path)) {
|
|
77
|
-
return proxy(req, res, next);
|
|
78
|
-
}
|
|
79
|
-
next();
|
|
80
|
-
});
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
this.restApi = new redis_smq_rest_api_1.RedisSMQRestApi(this.config, false);
|
|
84
|
-
const restApiCallback = yield this.restApi.getApplication();
|
|
85
|
-
this.app.use((req, res, next) => {
|
|
86
|
-
if (isApiRequest(req.path)) {
|
|
87
|
-
return restApiCallback(req, res);
|
|
88
|
-
}
|
|
89
|
-
next();
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
sendIndexHtml(res) {
|
|
94
|
-
const indexPath = path_1.default.join(this.webUIPath, 'index.html');
|
|
95
|
-
fs_1.default.readFile(indexPath, 'utf8', (err, data) => {
|
|
96
|
-
if (err) {
|
|
97
|
-
this.logger.error('Error reading index.html:', err);
|
|
98
|
-
return res.status(500).send('Error loading application');
|
|
99
|
-
}
|
|
100
|
-
const configScript = `<script>window.configs = ${JSON.stringify(this.webUIConfig)};</script>`;
|
|
101
|
-
const modifiedHtml = data.replace('</head>', `${configScript}</head>`);
|
|
102
|
-
res.send(modifiedHtml);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
setupRoutes() {
|
|
106
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
yield this.setupApi();
|
|
108
|
-
const { basePath } = this.config.webServer;
|
|
109
|
-
if (basePath !== '/') {
|
|
110
|
-
this.app.get('/', (_req, res) => res.redirect(basePath));
|
|
111
|
-
}
|
|
112
|
-
this.app.get('*', (req, res, next) => {
|
|
113
|
-
if (req.path.startsWith(path_1.default.posix.join(basePath, 'api')) ||
|
|
114
|
-
req.path.startsWith(path_1.default.posix.join(basePath, 'swagger'))) {
|
|
115
|
-
return next();
|
|
116
|
-
}
|
|
117
|
-
if (path_1.default.extname(req.path)) {
|
|
118
|
-
return next();
|
|
119
|
-
}
|
|
120
|
-
if (req.headers.accept && !req.headers.accept.includes('text/html')) {
|
|
121
|
-
return next();
|
|
122
|
-
}
|
|
123
|
-
this.sendIndexHtml(res);
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
bootstrap() {
|
|
128
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
-
if (!this.bootstrapped) {
|
|
130
|
-
yield this.setupMiddleware();
|
|
131
|
-
yield this.setupRoutes();
|
|
132
|
-
this.bootstrapped = true;
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
run() {
|
|
137
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
yield this.bootstrap();
|
|
139
|
-
const port = this.config.webServer.port;
|
|
140
|
-
this.httpServer = this.app.listen(port, () => {
|
|
141
|
-
this.logger.info(`Redis SMQ Web Server running on port ${port}`);
|
|
142
|
-
if (this.apiProxyTarget) {
|
|
143
|
-
this.logger.info(`Proxying API requests to ${this.apiProxyTarget}`);
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
this.logger.info(`Embedded Redis SMQ REST API is mounted`);
|
|
147
|
-
}
|
|
148
|
-
this.logger.info(`Serving static assets from: ${this.webUIPath}`);
|
|
149
|
-
this.logger.info(`Base path: ${this.config.webServer.basePath || '/'}`);
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
shutdown() {
|
|
154
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
-
if (this.httpServer && this.httpServer.listening) {
|
|
156
|
-
yield new Promise((resolve, reject) => {
|
|
157
|
-
var _a;
|
|
158
|
-
(_a = this.httpServer) === null || _a === void 0 ? void 0 : _a.close((err) => {
|
|
159
|
-
if (err)
|
|
160
|
-
return reject(err);
|
|
161
|
-
resolve();
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
this.httpServer = null;
|
|
165
|
-
this.logger.info('Redis SMQ Web Server has been shutdown.');
|
|
166
|
-
}
|
|
167
|
-
if (this.restApi) {
|
|
168
|
-
yield this.restApi.shutdown();
|
|
169
|
-
this.restApi = null;
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
exports.RedisSMQWebServer = RedisSMQWebServer;
|
|
175
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AASA,sDAA8B;AAC9B,gDAAwB;AACxB,4CAAoB;AAEpB,uDAA+C;AAK/C,2DAAqD;AACrD,8DAAuD;AAEvD,iEA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C;gBACH,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;gBACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;YAC9D,CAAC;YACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACjB,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;gBAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACtB,CAAC;QACH,CAAC;KAAA;CACF;AA1KD,8CA0KC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../tests/common/config.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,eAAO,MAAM,MAAM,EAAE,wBAkBpB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.config = void 0;
|
|
4
|
-
const redis_smq_common_1 = require("redis-smq-common");
|
|
5
|
-
exports.config = {
|
|
6
|
-
redis: {
|
|
7
|
-
client: redis_smq_common_1.ERedisConfigClient.IOREDIS,
|
|
8
|
-
options: {
|
|
9
|
-
host: '127.0.0.1',
|
|
10
|
-
port: 0,
|
|
11
|
-
showFriendlyErrorStack: true,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
logger: {
|
|
15
|
-
enabled: false,
|
|
16
|
-
options: {
|
|
17
|
-
logLevel: 'DEBUG',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
webServer: {
|
|
21
|
-
port: 8080,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../tests/common/config.ts"],"names":[],"mappings":";;;AASA,uDAAsD;AAGzC,QAAA,MAAM,GAA6B;IAC9C,KAAK,EAAE;QACL,MAAM,EAAE,qCAAkB,CAAC,OAAO;QAClC,OAAO,EAAE;YACP,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,CAAC;YACP,sBAAsB,EAAE,IAAI;SAC7B;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE,KAAK;QACd,OAAO,EAAE;YACP,QAAQ,EAAE,OAAO;SAClB;KACF;IACD,SAAS,EAAE;QACT,IAAI,EAAE,IAAI;KACX;CACF,CAAC"}
|