Skip to content

Instantly share code, notes, and snippets.

View motaz-hejaze's full-sized avatar
🏠
Working from home

Motaz Hejaze motaz-hejaze

🏠
Working from home
View GitHub Profile
import { userModel as Users } from '../models';
import aws from 'aws-sdk';
import fs from 'fs';
export default {
signup(req, res) {
aws.config.setPromisesDependency();
aws.config.update({
accessKeyId: process.env.ACCESSKEYID,
secretAccessKey: process.env.SECRETACCESSKEY,
@motaz-hejaze
motaz-hejaze / socket-cheatsheet.js
Created January 11, 2020 07:39 — 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