Skip to content

Instantly share code, notes, and snippets.

@maciejkorsan
Created May 20, 2019 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maciejkorsan/db11cf66843d8e1237009e531f26c107 to your computer and use it in GitHub Desktop.
Save maciejkorsan/db11cf66843d8e1237009e531f26c107 to your computer and use it in GitHub Desktop.
import Syncano from '@syncano/core'
export default (ctx) => {
const {channel, response} = new Syncano(ctx)
const {args} = ctx
try {
channel.publish(`global-messages`, {'light': args.light, 'status': args.status})
.then(res => {response(JSON.stringify(res), 200, 'application/json')})
} catch(e) {
console.log(e)
}
}
@joy057361
Copy link

000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment