Simple API for scheduling messages to be printed in the future.
Node version 8 or higher. This project requires Redis 2.8 to be installed and set up. Redis Keyspace Notifications also must be enabled:
redis-cli config get notify-keyspace-events
# 1) "notify-keyspace-events"
# 2) ""
redis-cli config set notify-keyspace-events Ex
# OK
If process.env.NODE_ENV !== 'production', then following environment variables must be filled in:
process.env.MA_SERVER_PORT
process.env.REDIS_HOST,
process.env.REDIS_PORT
Otherwise please add these values int config/dev file
Before starting the service we need to install all npm packages:
npm i
To start service simply run following command:
npm start
It will start API at http://localhost:8080/
To view API documantation open: http://localhost:8080/v1.0/docs After starting service.
To schedule a message you should sent an http POST request to /echoAtTime, please see API documentation after start, in Models section for detailed info.
Body example:
{
"message": "Really important message to be printed",
"datetime": "2018-08-15T08:17:05Z"
}
- Express - The web framework designed for building web applications and APIs.
- Infuse.js - Inversion of Control library
- Swagger Tools - Used to build and document RESTful API.
- Redis Keyspace Notifications - Used to scheduling messages.