filo_caspar/api/routerio.js

34 lines
925 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'
2018-06-26 18:35:12 +00:00
import { casparConnection } from './casparcg/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'
2018-06-26 18:35:12 +00:00
import * as settings from './settings/routes'
import * as schedule from './schedule/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)
2018-06-26 18:35:12 +00:00
casparConnection(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)
2018-06-26 18:35:12 +00:00
register(ctx, 'settings', settings)
register(ctx, 'schedule', schedule)
2016-04-10 08:37:05 +00:00
}
export default onConnection