devpro / ecorp-nodejs-demo

Node.js demonstration applications for E Corp fake company

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

E Corp Node.js demonstration applications

CI PKG Docker Image Version (latest semver)

Local development

  • Runs RabbitMQ in a container and check cluster status
docker run --name rabbitmq --rm --detach -p 5672:5672 -p 15672:15672 rabbitmq
docker exec rabbitmq rabbitmq-diagnostics cluster_status
  • Makes sure RabbitMQ is running ok
./samples/send.js
docker exec rabbitmq rabbitmqctl list_queues
./samples/receive.js
  • Installs dependencies (NPM packages)
npm install --dev
  • Runs the application (test it with curl http://localhost:3000/send)
npm start
  • Runs the application in a container (test it with curl http://localhost:8080/send)
docker build . -t ecorp-nodejs-demo
docker network create demo
docker network connect demo rabbitmq
docker run --name ecorp-nodejs-demo --rm -p 8080:3000 --net=demo -e "RABBITMQ_URL=amqp://rabbitmq:5672" ecorp-nodejs-demo
  • Cleans up
docker ps stop rabbitmq
docker network delete demo

References

About

Node.js demonstration applications for E Corp fake company


Languages

Language:JavaScript 93.8%Language:Dockerfile 6.2%