https://github.com/vectormike/crispy-train
Redis Pub/Sub implementation
https://github.com/vectormike/crispy-train
Last synced: about 1 year ago
JSON representation
Redis Pub/Sub implementation
- Host: GitHub
- URL: https://github.com/vectormike/crispy-train
- Owner: Vectormike
- Created: 2021-09-19T14:21:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-22T09:27:09.000Z (over 4 years ago)
- Last Synced: 2025-02-02T06:41:28.533Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 353 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Redis Pub/Sub
Install the dependencies:
```bash
npm install
```
Set the environment variables:
## Commands
Running locally:
```bash
npm run dev
```
Running in production:
```bash
npm start
```
Testing:
````bash
# run all tests
npm test
# run all tests in watch mode
npm test:watch
Docker:
# run docker container in development mode
npm docker:dev
# run docker compose for redis
docker-compose up -d
## Environment Variables
The environment variables can be found and modified in the `.env` file. They come with these default values:
# Port number
PORT=8000
# URL of the Mongo DB
MONGODB_URL=mongodb+srv://Vectormike:Redeemer@cluster0.widnr.mongodb.net/test
### API Endpoints
List of available routes:
**Publish routes**:\
`POST /v1/publish/:topic` - publish a topic\
**Subscribe routes**:\
`POST /v1/subscribe/:topic` - create and subscribe to a topic\
```
````