Clean / define public programmatic interface
junosuarez opened this issue · comments
juno suárez commented
pseudocode:
// simple case
const Radar = require('radar')
const configuration = require('./config.json')
const server = new Radar(configuration)
server.ready.then(_ => console.log('radar started'))
// adding radar to an existing HttpServer instance
// this might have unexpected behavior due to middleware ordering, but is useful for things like testing
const Radar = require('radar')
const configuration = require('./config.json')
const http = require('http')
const server = http.createServer()
const radar = new Radar(server, configuration)
juno suárez commented
Main export should be RadarServer constructor