Skip to content

agence-webup/rgb-panel-api

Repository files navigation

rgb-panel-api

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.

Installation instructions

Requirements

  • Node.js & npm

Clone the repo

git clone [email protected]:agence-webup/rgb-panel-api.git

Install dependencies

npm install

Configure AMQP endpoint

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.

Run

With Express

node app.js

With now

now dev

Deploy with ZEIT Now

now deploy --prod

Alternative: Docker

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

About

Node API component for the RGB Panel project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published