RedisSMQ REST API

RedisSMQ REST API provides an HTTP interface enabling any web-capable application to interact with the RedisSMQ message
queue using a RESTful API.
Features
- ๐ Clean and efficient implementation
- โ
Strict request/response validation using JSON Schema
- ๐ Native OpenAPI v3 support and Swagger UI
- ๐งช 90%+ code coverage with extensive testing
- ๐ฆ Support for both ESM & CJS modules
Prerequisites
Installation
npm install redis-smq-rest-api --save
yarn add redis-smq-rest-api
pnpm add redis-smq-rest-api
Version Compatibility
โ ๏ธ Important: Always install matching versions of RedisSMQ packages to ensure compatibility.
npm install redis-smq@x.x.x redis-smq-rest-api@x.x.x redis-smq-common@x.x.x
See version compatibility for details.
Configuration
The REST API configuration extends the base RedisSMQ configuration with additional API server settings.
Configuration Options
export type THttpApiConfig = {
port?: number;
host?: string;
basePath?: string;
};
export interface IRedisSMQHttpApiConfig extends IRedisSMQConfig {
apiServer?: THttpApiConfig;
}
Configuration Examples
import { RedisSmqRestApi } from 'redis-smq-rest-api';
const basicConfig: IRedisSMQHttpApiConfig = {
redis: {
client: 'ioredis',
options: {
host: '127.0.0.1',
port: 6379,
},
},
apiServer: {
host: '127.0.0.1',
port: 7210,
},
};
Usage
import { RedisSmqRestApi } from 'redis-smq-rest-api';
const config: IRedisSMQHttpApiConfig = {
redis: {
client: ERedisConfigClient.IOREDIS,
options: {
host: '127.0.0.1',
port: 6379,
},
},
apiServer: {
host: '127.0.0.1',
port: 7210,
},
};
const apiServer = new RedisSmqRestApi(config);
apiServer.run();
API Documentation
Swagger UI
Access the interactive API documentation at:
http://<HOSTNAME>:<PORT>/docs
OpenAPI Specification
Download the OpenAPI specification at:
http://<HOSTNAME>:<PORT>/assets/openapi-specs.json
Available Endpoints
For detailed endpoint documentation, refer to the Swagger UI.
License
This project is licensed under is released under the MIT License.