Skip to content

Instantly share code, notes, and snippets.

View RanKey1496's full-sized avatar
馃幆
Focusing

Jhon Gil Sepulveda RanKey1496

馃幆
Focusing
  • Medell铆n - Colombia
View GitHub Profile
@RanKey1496
RanKey1496 / socket-cheatsheet.js
Created October 16, 2018 04:40 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@RanKey1496
RanKey1496 / gist:223bd1e4f6853bd1c3c9f23dba3de7e8
Created October 16, 2018 04:40 — forked from yunghoy/gist:a425f91824d26461bb2e3653bc56ebbf
AMQP library (RabbitMQ) - async/await
alias babel-node='babel-node --presets stage-0'
------ RECV ------
// babel-node recv2.js "#"
// babel-node recv2.js "kern.*"
const amqp = require('amqplib');
const args = process.argv.slice(2);
if (args.length == 0) {
@RanKey1496
RanKey1496 / onion-demo.md
Created January 31, 2023 17:24 — forked from cdiaz/onion-demo.md
Arquitectura cebolla

Node.js y la arquitectura en capas de cebolla con InversifyJS

Este ejemplo demuestra c贸mo integrar InversifyJS con Express y como implementar aplicaciones que se adhieren a la arquitectura en capas de cebolla. Esta arquitectura de capas puede representarse en un diagrama como sigue:

onion

La principal diferencia entre una arquitectura de n-capas tradicional y la arquitectura cebolla es la direcci贸n de las dependencias entre capas.

En la arquitectura cebolla aplicamos el principio de inversi贸n de dependencias. Los detalles de la implementaci贸n (infraestructura) depende de las abstracciones (dominio):