This API endpoint accepts POST
requests containing JSON representations of drawings or simple text messages sent through rgb-panel-frontend
.
Requests are validated and sent to a RabbitMQ queue for processing by rgb-panel-worker
.
It was built with Node.js and Express.js.
It can also be deployed to ZEIT as Serverless Functions. If you choose to deploy to ZEIT, the API won't use Express, but rather the TypeScript file in the api
folder and the now.json
file at the root of the project.
- Node.js & npm
git clone [email protected]:agence-webup/rgb-panel-api.git
npm install
First, copy config/values.sample.js
to config/values.js
cp config/values.sample.js config/values.js
Edit values.js
and specify your AMQP endpoint.
Warning: Please note this project was made with RabbitMQ in mind. It might work on another type of AMQP endpoint as well, but we haven't tested this.
With Express
node app.js
With now
now dev
now deploy --prod
As an alternative to running the Express server yourself or deploying to ZEIT, you can run this API in a Docker container.
To do so, you need to configure the AMQP endpoint and build the image. Dependencies will then be retrieved during the build process.
docker built -t matrixapi .
You can now run the API with Docker while specifying the desired public port.
docker run -p 8080:3000 -d matrixapi