filo_caspar/api/routerio.js

28 lines
676 B
JavaScript
Raw Normal View History

2017-12-03 11:34:43 +00:00
import logger from '../log'
import { register } from './io/helper'
import { contentConnection } from './content/connection'
2016-04-10 08:37:05 +00:00
import * as content from './content/routes'
2016-04-14 04:01:51 +00:00
import * as engine from './engine/routes'
import * as graphic from './graphic/routes'
import * as preset from './preset/routes'
2016-04-10 08:37:05 +00:00
function onConnection(server, data) {
const io = server.socket
const socket = data.socket
const log = logger.child({
id: socket.id,
})
let ctx = { io, socket, log }
2017-12-03 11:34:43 +00:00
contentConnection(ctx)
2016-04-10 08:37:05 +00:00
register(ctx, 'content', content)
2016-04-14 04:01:51 +00:00
register(ctx, 'engine', engine)
register(ctx, 'graphic', graphic)
register(ctx, 'preset', preset)
2016-04-10 08:37:05 +00:00
}
export default onConnection