RedisSMQ REST API offers an HTTP interface which allows any web capable application to interact with the RedisSMQ message queue using a RESTful API.
Currently, RedisSMQ REST API is distributed as an RC release and is still in active development.
To start using the REST API make sure that you are using the latest RedisSMQ V8 RC release.
- A clean and simple implementation as always :).
- Strict Request/Response validation based on JSON Schema.
- Native OpenAPI v3 support and Swagger for developers.
- Rigorously tested codebase with code coverage no less than 90%.
- Both ESM & CJS modules are supported.
npm i redis-smq-rest-api@rc --save
The REST API configuration extends RedisSMQ Configuration while adding the API server configuration.
interface IApiServerConfig {
port?: number;
hostname?: string;
basePath?: string;
}
interface IRedisSMQHttpApiConfig extends IRedisSMQConfig {
apiServer?: IApiServerConfig;
}
import { IRedisSMQHttpApiConfig, 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();
Once your RedisSMQ API server is up and running you may view the API Reference and try it directly from
the Swagger UI which is accessible via http://<HOSTAME:PORT>/docs
.
The OpenAPI specification is available at http://<HOSTAME:PORT>/assets/openapi-specs.json