This small daemon can query APIs based on AMQP messages and push the result into a queue.
Designed to work especially with APIs which have time interval quotas, like Hypixel API (120 requests/min).
Examples can be found here: Example Requests.
There are two ways to use this software:
Node.js >= 10.0.0 and npm is required to be installed. Furthermore a RabbitMQ instance is required.
- Clone this repository:
git clone https://github.com/maxikg/api-client.git
- cd into the cloned repository:
cd api-client
- Install npm dependencies:
npm install
- Configure (modify
config.js
or use environment variables as they are used in config.js)
To run this software just type: node index.js
.
For production use you should take a look at PM2.
This app ships with a Docker image which you can use to run this app. Please install Docker and follow the instructions:
- Clone this repository:
git clone https://github.com/maxikg/api-client.git
- cd into the cloned repository:
cd api-client
- Build Docker image:
docker build -t maxikg/api-client .
Now you can run this software by using the docker
command:
docker run -e "AMQP_URL=<amqp-url>" \
-e "HYPIXEL_KEY=<hypixel-api-key>" \
-e "HYPIXEL_QUEUE=<hypixel-queue-name>" \
-e "MOJANG_UUID_QUEUE=<mojang-uuid-queue-name>" \
--restart=on-failure \
-d maxikg/api-client
In this case some environment variables are configured as well as the restart policy.
This library is distributed under the GNU General Public License version 3. A copy is shipped within the LICENSE.txt file.